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

Public Member Functions | List of all members
AiForceManager Class Reference

#include <ai_local.h>

Public Member Functions

size_t Size () const
 
const AiForceoperator[] (unsigned int index) const
 
AiForceoperator[] (unsigned int index)
 
int getIndex (AiForce *force) const
 
unsigned int getScriptForce (unsigned int index)
 
ai_force.cpp - AI force functions.
 AiForceManager ()
 
int GetForce (const CUnit &unit)
 
void RemoveDeadUnit ()
 
bool Assign (CUnit &unit, int force=-1)
 
void Update ()
 
unsigned int FindFreeForce (AiForceRole role=AiForceRoleDefault, int begin=0)
 
void CheckUnits (int *counter)
 

Detailed Description

AI force manager.

A Forces container for the force manager to handle

Constructor & Destructor Documentation

◆ AiForceManager()

AiForceManager::AiForceManager ( )

Member Function Documentation

◆ Assign()

bool AiForceManager::Assign ( CUnit unit,
int  force = -1 
)

Ai assign unit to force.

Parameters
unitUnit to assign to force.

◆ CheckUnits()

void AiForceManager::CheckUnits ( int *  counter)

◆ FindFreeForce()

unsigned int AiForceManager::FindFreeForce ( AiForceRole  role = AiForceRoleDefault,
int  begin = 0 
)

◆ GetForce()

int AiForceManager::GetForce ( const CUnit unit)

Find unit in force

Parameters
unitUnit to search for.
Returns
Force number, or -1 if not found

◆ getIndex()

int AiForceManager::getIndex ( AiForce force) const
inline

◆ getScriptForce()

unsigned int AiForceManager::getScriptForce ( unsigned int  index)
inline

◆ operator[]() [1/2]

AiForce& AiForceManager::operator[] ( unsigned int  index)
inline

◆ operator[]() [2/2]

const AiForce& AiForceManager::operator[] ( unsigned int  index) const
inline

◆ RemoveDeadUnit()

void AiForceManager::RemoveDeadUnit ( )

Cleanup units in forces.

◆ Size()

size_t AiForceManager::Size ( ) const
inline

◆ Update()

void AiForceManager::Update ( )

The documentation for this class was generated from the following files:
(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.