00001 #include "player.h" 00002 00003 Player::Player(){ 00004 00005 }; 00006 00007 00008 Player::Player(int id){ 00009 this->id = id; 00010 } 00011 00012 Player::Player(Player *p){ 00013 this->id = p->getID(); 00014 //mer.. 00015 } 00016 00017 00018 void Player::setID(int id){ 00019 this->id = id; 00020 } 00021 00022 00023 int Player::getID(){ 00024 return(this->id); 00025 } 00026 00027 00028 void Player::setName(const char *name){ 00029 this->name = (char *)malloc(strlen(name)+1); //ska de va +1 00030 strcpy(this->name, name); 00031 } 00032 00033 char *Player::getName(){ 00034 char *name = (char *)malloc(strlen(this->name)+1); 00035 strcpy(name, this->name); 00036 return(name); 00037 } 00038 00039 void Player::setLatancy(DWORD latancy){ 00040 this->latancy = latancy; 00041 } 00042 00043 int Player::getLatancy(void){ 00044 return(this->latancy); 00045 } 00046 00047 00048 void Player::setLastTimeStamp(DWORD timestamp){ 00049 this->lastTimeStamp = timestamp; 00050 } 00051 00052 int Player::getLastTimeStamp(void){ 00053 return(this->lastTimeStamp); 00054 }