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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
AiForce Class Reference

#include <ai_local.h>

Public Member Functions

 AiForce ()
 
void Remove (CUnit &unit)
 
void Reset (bool types=false)
 
size_t Size () const
 
bool IsAttacking () const
 
ai_plan.cpp - AI planning functions.
int PlanAttack ()
 

Public Attributes

bool Completed
 
bool Defending
 Flag saying force is complete build. More...
 
bool Attacking
 Flag saying force is defending. More...
 
AiForceRole Role
 Flag saying force is attacking. More...
 
std::vector< AiUnitTypeUnitTypes
 Role of the force. More...
 
CUnitCache Units
 Count and types of unit-type. More...
 
int FormerForce
 Units in the force. More...
 
AiForceAttackingState State
 Original force number. More...
 
Vec2i GoalPos
 Attack state. More...
 
Vec2i HomePos
 Attack point tile map position. More...
 
int WaitOnRallyPoint
 Return after attack tile map position. More...
 

Friends

class AiForceManager
 

ai_force.cpp - AI force functions.

void Attack (const Vec2i &pos)
 
void RemoveDeadUnit ()
 
void ReturnToHome ()
 
bool NewRallyPoint (const Vec2i &startPos, Vec2i *resultPos)
 
void Insert (CUnit &unit)
 

Detailed Description

Define an AI force.

A force is a group of units belonging together.

Constructor & Destructor Documentation

AiForce::AiForce ( )
inline

Member Function Documentation

void AiForce::Attack ( const Vec2i pos)
void AiForce::Insert ( CUnit unit)
bool AiForce::IsAttacking ( ) const
inline
bool AiForce::NewRallyPoint ( const Vec2i startPos,
Vec2i resultPos 
)
int AiForce::PlanAttack ( )

Plan an attack with a force. We know, that we must use a transporter.

Returns
True if target found, false otherwise.
Todo:

Perfect planning. Only works for water transporter!

transporter are more selective now (flag with unittypeland). We must manage it.

void AiForce::Remove ( CUnit unit)
inline
void AiForce::RemoveDeadUnit ( )

Ai clean units in a force.

void AiForce::Reset ( bool  types = false)
inline

Reset the force. But don't change its role and its demand.

void AiForce::ReturnToHome ( )
size_t AiForce::Size ( ) const
inline

Friends And Related Function Documentation

friend class AiForceManager
friend

Member Data Documentation

bool AiForce::Attacking

Flag saying force is defending.

bool AiForce::Completed
bool AiForce::Defending

Flag saying force is complete build.

int AiForce::FormerForce

Units in the force.

Vec2i AiForce::GoalPos

Attack state.

Vec2i AiForce::HomePos

Attack point tile map position.

AiForceRole AiForce::Role

Flag saying force is attacking.

AiForceAttackingState AiForce::State

Original force number.

CUnitCache AiForce::Units

Count and types of unit-type.

std::vector<AiUnitType> AiForce::UnitTypes

Role of the force.

int AiForce::WaitOnRallyPoint

Return after attack tile map position.


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.