-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVote.h
65 lines (51 loc) · 2.19 KB
/
Vote.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* Βέλλιος Γεώργιος-Σεραφείμ ΑΕΜ: 9471 [email protected] -- Μανούσος Διαγόρας ΑΕΜ: 9554 [email protected] */
#ifndef VOTE_H_INCLUDED
#define VOTE_H_INCLUDED
#include<iostream>
#include<string>
#include"Player.h"
using namespace std;
/*Γίνεται δήλωση της κλάσης της ψήφου (vote),καθώς και των μεταβλητών και των μεθόδων που περιέχει η κλάση .Καθε ψήφος έχει 2 μεταβλητές (οπότε 2 setters και 2 getters),
2 constructors ,με και χωρις ορίσματα, εναν destructor και 1 επιπλέον μεθόδο για εκτύπωση της κλάσης */
class Vote{
string voted;
string reason;
public:
/* Constructor της κλάσης Vote χωρίς ορίσματα. Δίνονται τα κενά σύνολά στις μεταβλητές voted και reason */
Vote(){
voted="";
reason="";
}
/* Constructor της κλάσης Vote με ορίσματα. Έχει ορίσματα Player p,string reason.Στη μεταβλητή voted αποδίδεται το όνομα του player p και
στη μεταβλητή reason της κλάσης το όρισμα reason της συνάρτησης*/
Vote(Player p, string reason){
voted=p.getName();
this->reason=reason;
}
/* Destructor της κλάσης Vote*/
~Vote(){
;
}
/*Setter της μεταβλητής voted με όρισμα string.*/
void setVoted(string voted){
this->voted=voted;
}
/*Setter της μεταβλητής reason με όρισμα string.*/
void setReason(string reason){
this->reason=reason;
}
/*Getter της μεταβλητής voted.*/
string getVoted(){
return voted;
}
/*Getter της μεταβλητής reason.*/
string getReason(){
return reason;
}
/*Εκτυπώνει τις μεταβλητές της κλάσης.*/
void status(){
cout<<"Voted: "<<getVoted()<<endl;
cout<<"Reason: "<<getReason()<<endl<<endl;
}
};
#endif // VOTE_H_INCLUDED