Changeset 5b92307 in network-game for common/Player.h


Ignore:
Timestamp:
Jan 20, 2014, 6:47:58 PM (11 years ago)
Author:
dportnoy <dmp1488@…>
Branches:
master
Children:
204edcf
Parents:
949cf70
Message:

id and targetPlayer are now both private members of the Player class and have getters and setters to access them

File:
1 edited

Legend:

Unmodified
Added
Removed
  • common/Player.h

    r949cf70 r5b92307  
    2121
    2222class Player {
     23private:
     24   unsigned int id;
     25   unsigned int targetPlayer;
     26
    2327public:
    2428
     
    4145   ~Player();
    4246
     47   unsigned int getId();
     48   unsigned int getTargetPlayer();
     49
    4350   void setId(unsigned int id);
     51   void setTargetPlayer(unsigned int id);
    4452   void setAddr(sockaddr_in addr);
    4553   void setClass(PlayerClass c);
     
    4856   void deserialize(char* buffer);
    4957
    50    bool updateTarget(const Player* targetPlayer);
     58   bool updateTarget(map<unsigned int, Player*>& players);
    5159   bool move(WorldMap *map);
    5260   void takeDamage(int damage);
     
    5563   void dropFlag(unsigned int flag, WorldMap* map);
    5664
    57    unsigned int id;
    5865   string name;
    5966   string password;
     
    6673   bool isChasing;
    6774   bool isAttacking;
    68    unsigned int targetPlayer;
    6975   bool isDead;
    7076
Note: See TracChangeset for help on using the changeset viewer.