_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Classes
groups.cpp File Reference
#include "stratagus.h"
#include "unit.h"
#include "iolib.h"
#include "script.h"
#include "unit_manager.h"
#include "unittype.h"

Classes

class  CUnitGroup
 

groups.cpp - The units' groups handling.

#define NUM_GROUPS   10
 
static CUnitGroup Groups [NUM_GROUPS]
 group of units More...
 
void SaveGroups (CFile &file)
 Number of groups predefined. More...
 
void CleanGroups ()
 Cleanup groups. More...
 
bool IsGroupTainted (int num)
 
const std::vector< CUnit * > & GetUnitsOfGroup (int num)
 Get the array of units of a particular group. More...
 
void ClearGroup (int num)
 Remove all units from a group. More...
 
void AddToGroup (CUnit **units, unsigned int nunits, int num)
 Add the array of units to the group. More...
 
void SetGroup (CUnit **units, unsigned int nunits, int num)
 Set the contents of a particular group with an array of units. More...
 
void RemoveUnitFromGroups (CUnit &unit)
 Remove a unit from a group. More...
 
static int CclGroup (lua_State *l)
 
void GroupCclRegister ()
 Register CCL group features. More...
 

Macro Definition Documentation

◆ NUM_GROUPS

#define NUM_GROUPS   10

How many groups supported

Function Documentation

◆ AddToGroup()

void AddToGroup ( CUnit **  units,
unsigned int  nunits,
int  num 
)

Add the array of units to the group.

Add units to group num contents from unit array "units"

Parameters
unitsArray of units to place into group.
nunitsNumber of units in array.
numGroup number for storage.

◆ CclGroup()

static int CclGroup ( lua_State *  l)
static

Define the group.

Parameters
lLua state.

◆ CleanGroups()

void CleanGroups ( )

Cleanup groups.

Clean up group part.

◆ ClearGroup()

void ClearGroup ( int  num)

Remove all units from a group.

Clear contents of group num

Parameters
numGroup number.

◆ GetUnitsOfGroup()

const std::vector<CUnit *>& GetUnitsOfGroup ( int  num)

Get the array of units of a particular group.

Return the units of group num

Parameters
numGroup number.
Returns
Returns an array of all units in the group.

◆ GroupCclRegister()

void GroupCclRegister ( )

Register CCL group features.

Register CCL features for groups.

◆ IsGroupTainted()

bool IsGroupTainted ( int  num)

◆ RemoveUnitFromGroups()

void RemoveUnitFromGroups ( CUnit unit)

Remove a unit from a group.

Remove unit from its groups

Parameters
unitUnit to remove from group.

◆ SaveGroups()

void SaveGroups ( CFile file)

Number of groups predefined.

Save groups.

Save groups.

Parameters
fileOutput file.

◆ SetGroup()

void SetGroup ( CUnit **  units,
unsigned int  nunits,
int  num 
)

Set the contents of a particular group with an array of units.

Set group num contents to unit array "units"

Parameters
unitsArray of units to place into group.
nunitsNumber of units in array.
numGroup number for storage.

Variable Documentation

◆ Groups

CUnitGroup Groups[NUM_GROUPS]
static

group of units

(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.