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

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
 Periodic called force manager handler. More...
 

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::AiForce ( )
inline

Member Function Documentation

◆ Attack()

void AiForce::Attack ( const Vec2i pos)

◆ Insert()

void AiForce::Insert ( CUnit unit)

◆ IsAttacking()

bool AiForce::IsAttacking ( ) const
inline

◆ NewRallyPoint()

bool AiForce::NewRallyPoint ( const Vec2i startPos,
Vec2i resultPos 
)

◆ PlanAttack()

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.

◆ Remove()

void AiForce::Remove ( CUnit unit)
inline

◆ RemoveDeadUnit()

void AiForce::RemoveDeadUnit ( )

Ai clean units in a force.

◆ Reset()

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

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

◆ ReturnToHome()

void AiForce::ReturnToHome ( )

◆ Size()

size_t AiForce::Size ( ) const
inline

Friends And Related Function Documentation

◆ AiForceManager

friend class AiForceManager
friend

Periodic called force manager handler.

Entry point of force manager, periodic called.

Member Data Documentation

◆ Attacking

bool AiForce::Attacking

Flag saying force is defending.

◆ Completed

bool AiForce::Completed

◆ Defending

bool AiForce::Defending

Flag saying force is complete build.

◆ FormerForce

int AiForce::FormerForce

Units in the force.

◆ GoalPos

Vec2i AiForce::GoalPos

Attack state.

◆ HomePos

Vec2i AiForce::HomePos

Attack point tile map position.

◆ Role

AiForceRole AiForce::Role

Flag saying force is attacking.

◆ State

AiForceAttackingState AiForce::State

Original force number.

◆ Units

CUnitCache AiForce::Units

Count and types of unit-type.

◆ UnitTypes

std::vector<AiUnitType> AiForce::UnitTypes

Role of the force.

◆ WaitOnRallyPoint

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.