00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _PLAYER_
00031 #define _PLAYER_
00032
00033 #include "VehicleSprite.h"
00034 #include "TankGroup.h"
00035 #include "Map.h"
00036 #include "Mission.h"
00037 #include <vector>
00038 #include "WinCond.h"
00039
00040 typedef enum {
00041 TEAM_ID_START = 1000,
00042 TEAM_RED,
00043 TEAM_BLUE,
00044 TEAM_YELLOW,
00045 TEAM_BLACK,
00046 TEAM_WHITE
00047 } TeamColor;
00048
00049 class Player
00050 {
00051 public:
00052 int base;
00053 std::vector<VehicleSprite*> vehicles;
00054 VehicleSprite *currentVehicle;
00055 std::vector<VehicleGroup*> platoons;
00056
00057 protected:
00058 int myId;
00059 Map *terrain_map;
00060 int rotate_camera;
00061 Cond wincond;
00062
00063 public:
00064 Player(int plyId, class MissionDef *mission);
00065
00066 VehicleSprite* getVehicleSprite() { return currentVehicle; }
00067 void doKey(int key, int x, int y,
00068 bool special, bool down, unsigned int modifiers);
00069 void setCurrentVehicle(int index);
00070 void setCurrentPlatoon(int index);
00071 void endTurn();
00072 void update(void);
00073 void paint(void);
00074 void addVehicle(VehicleSprite *v);
00075 Cond& getWinCond() { return wincond; }
00076
00077 void setId(int plyId);
00078 int getId();
00079
00080 protected:
00081 int keyToGroup(int key);
00082 };
00083
00084 #endif //_PLAYER_