Changeset 9656 in orxonox.OLD for trunk/src/lib/network/player_stats.h
- Timestamp:
- Aug 4, 2006, 11:01:28 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/player_stats.h
r9110 r9656 16 16 enum 17 17 { 18 TEAM_NOTEAM = -3,19 TEAM_RANDOM = -2,20 TEAM_SPECTATOR = -118 TEAM_NOTEAM = -3, 19 TEAM_RANDOM = -2, 20 TEAM_SPECTATOR = -1 21 21 }; 22 22 23 23 24 struct PlayerScore … … 26 27 int score; 27 28 }; 29 30 28 31 typedef std::list<PlayerScore> TeamScoreList; 29 32 typedef std::map<int,TeamScoreList> ScoreList; 30 33 34 31 35 //! A class for storing player information 32 class PlayerStats : public Synchronizeable 36 class PlayerStats : public Synchronizeable 33 37 { 34 38 … … 37 41 PlayerStats( int userId ); 38 42 virtual ~PlayerStats(); 39 43 40 44 virtual void varChangeHandler( std::list<int> & id ); 41 45 42 46 static PlayerStats * getStats( int userId ); 43 44 inline int getUserId(){ return userId; } 45 47 inline int getAssignedUserId(){ return this->assignedUserId; } 48 49 46 50 inline int getTeamId(){ return teamId; } 47 51 inline void setTeamId( int teamId ){ this->teamId = teamId; } 48 52 49 53 inline int getPreferedTeamId(){ return preferedTeamId; } 50 inline void setPreferedTeamId( int preferedTeamId ) { this->preferedTeamId = preferedTeamId; }51 54 inline void setPreferedTeamId( int preferedTeamId ) { this->preferedTeamId = preferedTeamId; } 55 52 56 inline int getScore(){ return score; } 53 57 inline void setScore( int score ){ this->score = score; } 54 58 55 59 inline int getPlayableClassId(){ return playableClassId; } 56 60 void setPlayableClassId( int classId ){ this->playableClassId = classId; }; 57 61 58 62 inline int getPlayableUniqueId(){ return playableUniqueId; } 59 63 void setPlayableUniqueId( int uniqueId ); 60 64 61 65 inline std::string getModelFileName(){ return modelFileName; } 62 66 inline void setModelFileName( std::string filename ){ modelFileName = filename; } 63 67 64 68 Playable * getPlayable(); 65 69 66 70 inline std::string getNickName(){ return this->nickName; } 67 71 void setNickName( std::string nick ); 68 static bool changeNickHandler( Message Id messageId, byte * data, int dataLength, void * someData, int userId);72 static bool changeNickHandler( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId ); 69 73 void shellNick( const std::string& newNick ); 70 74 71 75 static void deleteAllPlayerStats(); 72 76 73 77 static ScoreList getScoreList(); 74 78 79 75 80 private: 76 int userId; //!< userId 77 int teamId; //!< teamId 78 int preferedTeamId; //!< preferedTeamId 81 void init(); 79 82 80 std::string nickName; //!< players nickname81 std::string oldNickName; //!< nickname player had before82 83 83 int score; //!< users score points 84 int playableClassId; //!< players playable class id 85 int playableUniqueId; //!< playable's uniqueId 86 std::string modelFileName; //!< model filename 84 private: 85 // handles for SynchronizeableVars 86 int userId_handle; 87 int teamId_handle; 88 int preferedTeamId_handle; 89 int score_handle; 90 int playableClassId_handle; 91 int playableUniqueId_handle; 92 int modelFileName_handle; 93 int nickName_handler; 87 94 88 Playable * playable; //!< pointer to players playable 95 int assignedUserId; //!< userId 96 int teamId; //!< teamId 97 int preferedTeamId; //!< preferedTeamId 89 98 90 // handles for SynchronizeableVars 91 int userId_handle; 92 int teamId_handle; 93 int preferedTeamId_handle; 94 int score_handle; 95 int playableClassId_handle; 96 int playableUniqueId_handle; 97 int modelFileName_handle; 98 int nickName_handler; 99 100 void init(); 99 std::string nickName; //!< players nickname 100 std::string oldNickName; //!< nickname player had before 101 102 int score; //!< users score points 103 int playableClassId; //!< players playable class id 104 int playableUniqueId; //!< playable's uniqueId 105 std::string modelFileName; //!< model filename 106 107 Playable * playable; //!< pointer to players playable 101 108 }; 102 109
Note: See TracChangeset
for help on using the changeset viewer.