public:
Team
who;
Team
cteam;
// The team this relative is on (for quick reference)
short
flags;
_TCHAR
name[MAX_TEAM_NAME_SIZE];
_TCHAR
teamMotto[MAX_MOTTO_SIZE];
uchar
member[NUM_COUNS];
short
stance[NUM_TEAMS];
short
firstColonel;
// Pilot ID indexies for this country
short
firstCommander;
short
firstWingman;
short
lastWingman;
float
playerRating;
// Average player rating over last 5 player missions
CmpaignTime
lastPlayerMission;
// Last player mission flown
uchar
airExperience;
// Experience for aircraft (affects pilot's skill)
uchar
airDefenseExperience;
// Experience for air defenses
uchar
groundExperience;
// Experience for ground troops
uchar
navalExperience;
// Experience for ships
TeamStatusType
startStats;
VU_ID
bonusObjs[MAX_BONUSES];
CampaignTime
bonusTime[MAX_BONUSES];
uchar
max_vehicle[4];
// Max vehicle slot by air/ground/airdefense/naval
ATM
atm;
GTM
gtm;
NTM
ntm;
uchar
teamFlag;
// This team's flag (as in cloth)
uchar
teamColor;
// This team's color [Index into color table for TE]
uchar
equipment;
// What equipment table to use
TeamDoctrine
doctrine;
public:
// Constructors
TeamClass (int typeindex, Control owner);
TeamClass (VU_BYTE **stream);
TeamClass (FILE *file);
~TeamClass (void);
// event handlers
virtual int Handle(VuEvent *event);
virtual int Handle(VuFullUpdateEvent *event);
virtual int Handle(VuPositionUpdateEvent *event);
virtual int Handle(VuEntityCollisionEvent *event);
virtual int Handle(VuTransferEvent *event);
virtual int Handle(VuSessionEvent *event);
virtual VU_ERRCODE InsertionCallback(void);
virtual VU_ERRCODE RemovalCallback(void);
virtual int Wake (void) {return 0;};
virtual int Sleep (void) {return 0;};
// Access Functions
short GetInitiative (void) { return initiative; }
ushort GetSupplyAvail (void) { return supplyAvail; }
ushort GetFuelAvail (void) { return fuelAvail; }
ushort GetReplacementsAvail (void) { return replacementsAvail; }
short GetReinforcement (void) { return reinforcement; }
uchar GetObjTypePriority (int type) { return objtype_priority[type]; }
uchar GetUnitTypePriority (int type) { return unittype_priority[type];
}
uchar GetMissionPriority (int type) { return mission_priority[type]; }
TeamStatusType *GetCurrentStats (void) { return ¤tStats; }
TeamGndActionType *GetGroundAction (void) { return &groundAction; }
TeamAirActionType *GetDefensiveAirAction (void) { return &defensiveAirAction;
}
TeamAirActionType *GetOffensiveAirAction (void) { return &offensiveAirAction;
}
void SetInitiative (short);
void SetReinforcement (short);
uchar *SetAllObjTypePriority (void);
uchar *SetAllUnitTypePriority (void);
uchar *SetAllMissionPriority (void);
void SetObjTypePriority (int, uchar);
void SetUnitTypePriority (int, uchar);
void SetMissionPriority (int, uchar);
void SetSupplyAvail (int);
void SetFuelAvail (int);
void SetReplacementsAvail (int);
TeamStatusType *SetCurrentStats (void);
TeamGndActionType *SetGroundAction (void);
TeamAirActionType *SetDefensiveAirAction (void);
TeamAirActionType *SetOffensiveAirAction (void);
void AddInitiative (short);
void AddReinforcement (short);
// Core functions
virtual int SaveSize (void);
virtual int Save (VU_BYTE **stream);
virtual int Save (FILE *file);
void ReadDoctrineFile (void);
void ReadPriorityFile (int tactic);
int CheckControl(GridIndex X, GridIndex Y);
void SetActive(int act);
void DumpHeader(void);
void Dump(void);
void DoFullUpdate (VuTargetEntity *target);
int CStance(Control country)
{ return stance[::GetTeam(country)]; }
int TStance(Team team)
{ return stance[team]; }
int Initiative(void)
{ return initiative; }
int HasSatelites(void)
{ return flags & TEAM_HASSATS; }
ATM GetATM(void)
{ return atm; }
GTM GetGTM(void)
{ return gtm; }
NTM GetNTM(void)
{ return ntm; }
void SetName (_TCHAR *newname);
_TCHAR* GetName(void);
void SetFlag (uchar flag)
{ teamFlag = flag; }
void SetEquipment (uchar e)
{ equipment = e; }
int GetFlag (void)
{ return (int) teamFlag; }
void SetColor (uchar color)
{ teamColor = color; }
int GetColor (void)
{ return (int) teamColor; }
int GetEquipment (void)
{ return (int) equipment; }
void SetMotto (_TCHAR *motto);
_TCHAR *GetMotto (void);
TeamDoctrine* GetDoctrine (void)
{ return &doctrine; }
//
int OnOffensive(void)
{ return offensiveLoss; }
uchar GetGroundActionType (void)
{ return groundAction.actionType; }
void SelectGroundAction (void);
void SelectAirActions (void);
void SetGroundAction (TeamGndActionType *action);
virtual int IsTeam (void) { return TRUE; };
// Dirty Data
void MakeTeamDirty (Dirty_Team bits, Dirtyness score);
void WriteDirty (unsigned char **stream);
void ReadDirty (unsigned char **stream);
#define MAX_TEAM_NAME_SIZE 20
#define MAX_MOTTO_SIZE 200
#define MAX_AIR_ACTIONS 14
#define ACTION_TIME_MIN 30
// Time per action, in minutes
#define MAX_BONUSES 20
// Number of SOs which can receive bonuses at one time
#define MAX_TGTTYPE 36
#define MAX_UNITTYPE 20
// =======================================
// Priority tables
// =======================================
// =======================================
// Local classes
// =======================================
typedef AirTaskingManagerClass* ATM;
typedef GroundTaskingManagerClass* GTM;
typedef NavalTaskingManagerClass* NTM;
typedef CampBaseClass* CampEntity;
public:
int
simFlags;
float radarShootShootPct;
float heatShootShootPct;
TeamDoctrine (void) {simFlags = 0;};
enum {
SimRadarShootShoot = 0x1,
SimHeatShootShoot
= 0x2
};
int
IsSet (int val) { return simFlags & val;};
void Set (int val) {simFlags |=
val;};
void Clear (int val) {simFlags &=
~val;};
float RadarShootShootPct (void)
{return radarShootShootPct;};
float HeatShootShootPct (void) {return
heatShootShootPct;};
};