Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
SidesList Class Reference

#include <SidesList.h>

Inherits SubsystemInterface, and Snapshot.

Public Types

enum  { MAX_TEAM_DEPTH = 3 }
 

Public Member Functions

 SidesList ()
 
 ~SidesList ()
 
void init ()
 
void update ()
 
void reset ()
 
Int getNumSides ()
 
void emptySides ()
 
void addSide (const Dict *d)
 
void removeSide (Int i)
 
SidesInfogetSideInfo (Int side)
 
SidesInfogetSkirmishSideInfo (Int side)
 
Int getNumSkirmishSides ()
 
SidesInfofindSideInfo (AsciiString name, Int *index=NULL)
 
SidesInfofindSkirmishSideInfo (AsciiString name, Int *index=NULL)
 
void prepareForMP_or_Skirmish (void)
 
Int getNumTeams ()
 
void emptyTeams ()
 
void addTeam (const Dict *d)
 
void removeTeam (Int i)
 
TeamsInfogetTeamInfo (Int team)
 
TeamsInfogetSkirmishTeamInfo (Int team)
 
Int getNumSkirmishTeams ()
 
void addSkirmishTeam (const Dict *d)
 
TeamsInfofindTeamInfo (AsciiString name, Int *index=NULL)
 
Bool isPlayerDefaultTeam (TeamsInfo *t)
 
void clear ()
 
Bool validateSides (void)
 
void addPlayerByTemplate (AsciiString playerTemplateName)
 
- Public Member Functions inherited from SubsystemInterface
 SubsystemInterface ()
 
virtual ~SubsystemInterface ()
 
virtual void postProcessLoad ()
 
virtual void draw (void)
 
void UPDATE (void)
 
void DRAW (void)
 
AsciiString getName (void)
 
void setName (AsciiString name)
 
- Public Member Functions inherited from Snapshot
 Snapshot (void)
 
 ~Snapshot (void)
 

Static Public Member Functions

static Bool ParseSidesDataChunk (DataChunkInput &file, DataChunkInfo *info, void *userData)
 Reads sides (including build list info && player dicts.)
 
static void WriteSidesDataChunk (DataChunkOutput &chunkWriter)
 Writes sides (including build list info.)
 

Protected Member Functions

virtual void crc (Xfer *xfer)
 
virtual void xfer (Xfer *xfer)
 
virtual void loadPostProcess (void)
 
Bool validateAllyEnemyList (const AsciiString &tname, AsciiString &allies)
 

Protected Attributes

Int m_numSides
 
SidesInfo m_sides [MAX_PLAYER_COUNT]
 
Int m_numSkirmishSides
 
SidesInfo m_skirmishSides [MAX_PLAYER_COUNT]
 
TeamsInfoRec m_teamrec
 
TeamsInfoRec m_skirmishTeamrec
 
- Protected Attributes inherited from SubsystemInterface
AsciiString m_name
 

Detailed Description

This is a singleton class that maintains the list of Sides. In RTS it is associated with the Player singleton.
Note that a side corresponds to a Player in the game. The lightweight Side is used to give the WB Editor somewhere to hang build lists, as it doesn't instantiate the Player subsystem

jba.

Definition at line 135 of file SidesList.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MAX_TEAM_DEPTH 

Definition at line 184 of file SidesList.h.

Constructor & Destructor Documentation

◆ SidesList()

SidesList::SidesList ( void )

SidesList - Constructor.

Definition at line 206 of file SidesList.cpp.

◆ ~SidesList()

SidesList::~SidesList ( void )

SidesList - Destructor -

Definition at line 213 of file SidesList.cpp.

Member Function Documentation

◆ addPlayerByTemplate()

void SidesList::addPlayerByTemplate ( AsciiString playerTemplateName)

Definition at line 672 of file SidesList.cpp.

◆ addSide()

void SidesList::addSide ( const Dict * d)

Definition at line 602 of file SidesList.cpp.

◆ addSkirmishTeam()

void SidesList::addSkirmishTeam ( const Dict * d)

Definition at line 614 of file SidesList.cpp.

◆ addTeam()

void SidesList::addTeam ( const Dict * d)

Definition at line 609 of file SidesList.cpp.

◆ clear()

void SidesList::clear ( void )

SidesList - clear -

Definition at line 228 of file SidesList.cpp.

◆ crc()

void SidesList::crc ( Xfer * xfer)
protectedvirtual

CRC

Implements Snapshot.

Definition at line 844 of file SidesList.cpp.

◆ emptySides()

void SidesList::emptySides ( )

Definition at line 584 of file SidesList.cpp.

◆ emptyTeams()

void SidesList::emptyTeams ( )

Definition at line 596 of file SidesList.cpp.

◆ findSideInfo()

SidesInfo * SidesList::findSideInfo ( AsciiString name,
Int * index = NULL )

Definition at line 395 of file SidesList.cpp.

◆ findSkirmishSideInfo()

SidesInfo * SidesList::findSkirmishSideInfo ( AsciiString name,
Int * index = NULL )

Definition at line 409 of file SidesList.cpp.

◆ findTeamInfo()

TeamsInfo * SidesList::findTeamInfo ( AsciiString name,
Int * index = NULL )

Definition at line 390 of file SidesList.cpp.

◆ getNumSides()

Int SidesList::getNumSides ( )
inline

Definition at line 153 of file SidesList.h.

◆ getNumSkirmishSides()

Int SidesList::getNumSkirmishSides ( )
inline

Definition at line 159 of file SidesList.h.

◆ getNumSkirmishTeams()

Int SidesList::getNumSkirmishTeams ( )
inline

Definition at line 172 of file SidesList.h.

◆ getNumTeams()

Int SidesList::getNumTeams ( )
inline

Definition at line 165 of file SidesList.h.

◆ getSideInfo()

SidesInfo * SidesList::getSideInfo ( Int side)
inline

Definition at line 219 of file SidesList.h.

◆ getSkirmishSideInfo()

SidesInfo * SidesList::getSkirmishSideInfo ( Int side)
inline

Definition at line 230 of file SidesList.h.

◆ getSkirmishTeamInfo()

TeamsInfo * SidesList::getSkirmishTeamInfo ( Int team)
inline

Definition at line 214 of file SidesList.h.

◆ getTeamInfo()

TeamsInfo * SidesList::getTeamInfo ( Int team)
inline

Definition at line 209 of file SidesList.h.

◆ init()

void SidesList::init ( )
inlinevirtual
  • Assign any default values to data required for the class
    • Allocate any memory and resources needed throughout the lifetime of the class

Implements SubsystemInterface.

Definition at line 144 of file SidesList.h.

◆ isPlayerDefaultTeam()

Bool SidesList::isPlayerDefaultTeam ( TeamsInfo * t)

Definition at line 565 of file SidesList.cpp.

◆ loadPostProcess()

void SidesList::loadPostProcess ( void )
protectedvirtual

Load post process

Implements Snapshot.

Definition at line 901 of file SidesList.cpp.

◆ ParseSidesDataChunk()

Bool SidesList::ParseSidesDataChunk ( DataChunkInput & file,
DataChunkInfo * info,
void * userData )
static

Reads sides (including build list info && player dicts.)

SidesList::ParseSidesDataChunk - read a Sides chunk. Format is the newer CHUNKY format. See SidesList::WriteSidesDataChunk for the writer. Input: DataChunkInput

Definition at line 243 of file SidesList.cpp.

◆ prepareForMP_or_Skirmish()

void SidesList::prepareForMP_or_Skirmish ( void )

Definition at line 478 of file SidesList.cpp.

◆ removeSide()

void SidesList::removeSide ( Int i)

Definition at line 619 of file SidesList.cpp.

◆ removeTeam()

void SidesList::removeTeam ( Int i)

Definition at line 633 of file SidesList.cpp.

◆ reset()

void SidesList::reset ( void )
virtual

SidesList - reset -

Implements SubsystemInterface.

Definition at line 220 of file SidesList.cpp.

◆ update()

void SidesList::update ( )
inlinevirtual
  • Update methods are the place to do system per frame processing. You should call the system update once each time through the game loop to service the system.
    • Note that currently the GameClient and GameLogic will be updating at different rates where the logic is running real time, and the client will adjust how many loops can be done during one server time slice in order to improve performance on low end machines.

Implements SubsystemInterface.

Definition at line 145 of file SidesList.h.

◆ validateAllyEnemyList()

Bool SidesList::validateAllyEnemyList ( const AsciiString & tname,
AsciiString & allies )
protected

Definition at line 638 of file SidesList.cpp.

◆ validateSides()

Bool SidesList::validateSides ( void )

Definition at line 725 of file SidesList.cpp.

◆ WriteSidesDataChunk()

void SidesList::WriteSidesDataChunk ( DataChunkOutput & chunkWriter)
static

Writes sides (including build list info.)

SidesList::WriteSidesDataChunk - Writes a Sides chunk. Format is the newer CHUNKY format. See SidesList::ParseSidesDataChunk for the reader. Input: DataChunkInput

Definition at line 329 of file SidesList.cpp.

◆ xfer()

void SidesList::xfer ( Xfer * xfer)
protectedvirtual

Xfer method Version Info: 1: Initial version

Implements Snapshot.

Definition at line 854 of file SidesList.cpp.

Member Data Documentation

◆ m_numSides

Int SidesList::m_numSides
protected

Definition at line 196 of file SidesList.h.

◆ m_numSkirmishSides

Int SidesList::m_numSkirmishSides
protected

Definition at line 199 of file SidesList.h.

◆ m_sides

SidesInfo SidesList::m_sides[MAX_PLAYER_COUNT]
protected

Definition at line 197 of file SidesList.h.

◆ m_skirmishSides

SidesInfo SidesList::m_skirmishSides[MAX_PLAYER_COUNT]
protected

Definition at line 200 of file SidesList.h.

◆ m_skirmishTeamrec

TeamsInfoRec SidesList::m_skirmishTeamrec
protected

Definition at line 203 of file SidesList.h.

◆ m_teamrec

TeamsInfoRec SidesList::m_teamrec
protected

Definition at line 202 of file SidesList.h.


The documentation for this class was generated from the following files: