summaryrefslogtreecommitdiff
path: root/src/search/Save.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-01-28 19:56:13 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-01-28 19:56:13 (GMT)
commit7c53ca7799832920066c23cfad2f1d7fa82233c7 (patch)
treea29fab25e584fb7f0d3705f13ac0a97abaae122a /src/search/Save.cpp
parent28d4aecb6c31ac1e450c1f073a0db13437d9d5d1 (diff)
downloadpowder-7c53ca7799832920066c23cfad2f1d7fa82233c7.zip
powder-7c53ca7799832920066c23cfad2f1d7fa82233c7.tar.gz
Voting, fix save browser
Diffstat (limited to 'src/search/Save.cpp')
-rw-r--r--src/search/Save.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/search/Save.cpp b/src/search/Save.cpp
index 5bcb0e9..47ac61a 100644
--- a/src/search/Save.cpp
+++ b/src/search/Save.cpp
@@ -11,7 +11,7 @@
Save::Save(Save & save) :
userName(save.userName), name(save.name), Description(save.Description), date(
save.date), Published(save.Published), id(save.id), votesUp(
- save.votesUp), votesDown(save.votesDown), data(NULL) {
+ save.votesUp), votesDown(save.votesDown), data(NULL), vote(save.vote) {
if (save.data) {
std::cout << data << " " << save.data << std::endl;
data = (unsigned char *) malloc(save.dataLength);
@@ -24,14 +24,14 @@ Save::Save(int _id, int _date, int _votesUp, int _votesDown, string _userName,
string _name) :
id(_id), votesUp(_votesUp), votesDown(_votesDown), userName(_userName), name(
_name), Description("No description provided"), date(_date), Published(
- true), data(NULL) {
+ true), data(NULL), vote(0) {
}
-Save::Save(int _id, int date_, int _votesUp, int _votesDown, string _userName,
+Save::Save(int _id, int date_, int _votesUp, int _votesDown, int _vote, string _userName,
string _name, string description_, bool published_) :
id(_id), votesUp(_votesUp), votesDown(_votesDown), userName(_userName), name(
_name), Description(description_), date(date_), Published(
- published_), data(NULL) {
+ published_), data(NULL), vote(_vote) {
}
Save::~Save()
@@ -49,6 +49,15 @@ string Save::GetName() {
return name;
}
+void Save::SetVote(int vote)
+{
+ this->vote = vote;
+}
+int Save::GetVote()
+{
+ return vote;
+}
+
void Save::SetUserName(string userName) {
this->userName = userName;
}