| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- /*
- ** Command & Conquer Renegade(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /***********************************************************************************************
- *** Confidential - Westwood Studios ***
- ***********************************************************************************************
- * *
- * Project Name : Commando *
- * *
- * $Archive:: /Commando/Code/Commando/team.h $*
- * *
- * $Author:: Tom_s $*
- * *
- * $Modtime:: 11/13/01 7:54p $*
- * *
- * $Revision:: 35 $*
- * *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #if defined(_MSV_VER)
- #pragma once
- #endif
- #ifndef TEAM_H
- #define TEAM_H
- #include "vector3.h"
- #include "bittype.h"
- #include "soldier.h"
- #include "widestring.h"
- const int MAX_TEAMNAME_SIZE = 10; //including NULL
- class cPacket;
- //------------------------------------------------------------------------------------
- //
- // Holds data about a team
- //
- class cTeam : public NetworkObjectClass {
- public:
- friend class cTeamManager; // so that only cTeamManager can call ~cTeam
- cTeam(void);
- virtual uint32 Get_Network_Class_ID(void) const {return NETCLASSID_TEAM;}
- virtual void Delete(void) {delete this;}
- //
- // Server only
- //
- void Increment_Kills(void);
- void Increment_Deaths(void);
- void Increment_Score(float increment);
- //void Increment_Money(int increment);
- //
- // Client only
- //
- void Set_Kills(int new_kills);
- void Set_Deaths(int new_deaths);
- void Set_Score(float new_score);
- //void Set_Money(int new_money);
- //
- // Client or server
- //
- void Init(int team_number);
- void Init_Team_Name(void);
- WideStringClass Get_Name(void) const {return Name;}
- int Get_Id(void) const {return TeamNumber;}
- void Reset(void);
- int Tally_Size(void) const;
- int Get_Kills(void) const {return Kills;}
- int Get_Deaths(void) const {return Deaths;}
- float Get_Score(void) const {return Score;}
- //int Get_Money(void) const {return Money;}
- float Get_Kill_To_Death_Ratio(void) const;
- void Get_Team_String(int rank, WideStringClass & string) const;
- Vector3 Get_Color(void) const;
- int Tally_Money(void) const;
- //
- // Server-to-client data importing/exporting
- //
- virtual void Import_Creation(BitStreamClass &packet);
- virtual void Import_Rare(BitStreamClass &packet);
- virtual void Import_Occasional(BitStreamClass &packet);
- virtual void Import_Frequent(BitStreamClass &packet);
- virtual void Export_Creation(BitStreamClass &packet);
- virtual void Export_Rare(BitStreamClass &packet);
- virtual void Export_Occasional(BitStreamClass &packet);
- virtual void Export_Frequent(BitStreamClass &packet);
- private:
- ~cTeam(void); // only the cTeamManager can destroy...
- WideStringClass Name;
- int Kills;
- int Deaths;
- float Score;
- int Money;
- int TeamNumber;
- };
- #endif // TEAM_H
|