#ifndef _PLAYER_H #define _PLAYER_H #include "Compiler.h" #if defined WINDOWS #include #include #elif defined LINUX #include #endif #include #include "Common.h" #include "WorldMap.h" using namespace std; class Player { public: enum PlayerClass { CLASS_NONE, CLASS_WARRIOR, CLASS_RANGER }; enum AttackType { ATTACK_NONE, ATTACK_MELEE, ATTACK_RANGED }; Player(); Player(const Player& p); Player(string name, string password); ~Player(); void serialize(char* buffer); void deserialize(char* buffer); void setClass(PlayerClass c); void setId(int id); void setAddr(sockaddr_in addr); bool move(WorldMap *map); void takeFlag(int flag, WorldMap *map); void dropFlag(int flag, WorldMap *map); int id; string name; string password; sockaddr_in addr; FLOAT_POSITION pos; POSITION target; unsigned long long timeLastUpdated; int playerClass; int maxHealth; int health; int attackType; int damage; int team; // 0 is blue, 1 is red bool hasBlueFlag; bool hasRedFlag; }; #endif