root/trunk/player.hh

Revision 1, 1.7 kB (checked in by poillubo, 2 years ago)

* initial import

Line 
1 /*
2  *  RoxTS
3  *  player.hh
4  *  Copyright (C) 2006  VERRIER AnaĆ«l
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; either version 2 of the License, or
9  *  (at your option) any later version.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20
21 #ifndef PLAYER_HH
22 #define PLAYER_HH
23
24 #include <string>
25 #include <set>
26 #include <vector>
27
28 #include "item.hh"
29 #include "resource.hh"
30
31 using namespace std;
32
33 class Player
34 {
35   // Attributes
36   private:
37 #ifdef SERVER
38     static uint8 maxId;
39 #endif
40     uint8 id;
41     int socket;
42     set<Item *> selectedItems;
43     string playerName;
44     vector<Resource> resources;
45   // Operations
46   public:
47 #ifdef SERVER
48     Player(int socket, string playerName = "Marvin");
49 #endif
50 #ifdef CLIENT
51     Player(uint8 id, int socket, string playerName = "Marvin");
52 #endif
53     void addSelectedItem(Item * item);
54     void removeSelectedItem(Item * item);
55     void clearSelectedItem();
56     set<Item *> getSelectedItem();
57     bool isSelectedItem(Item * item);
58     uint8 getId();
59     int getSocket();
60     void setSocket(int socket);
61     string getPlayerName();
62     void setPlayerName(string playername);
63     uint32 getResource(ResourceName r);
64     void setResource(ResourceName r, uint32 quantity);
65 };
66
67 #endif
Note: See TracBrowser for help on using the browser.