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

AiForce Class Reference

#include <ai_local.h>

List of all members.


ai_force.cpp - AI force functions.

void Attack (const Vec2i &pos)
void RemoveDeadUnit ()
void ReturnToHome ()

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.
bool Attacking
 Flag saying force is defending.
AiForceRole Role
 Flag saying force is attacking.
std::vector< AiUnitTypeUnitTypes
 Role of the force.
CUnitCache Units
 Count and types of unit-type.
AiForceAttackingState State
 Units in the force.
Vec2i GoalPos
 Attack state.
Vec2i HomePos
 Attack point tile map position.

Friends

class AiForceManager

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::Remove ( CUnit unit  )  [inline]

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

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

size_t AiForce::Size (  )  const [inline]

bool AiForce::IsAttacking (  )  const [inline]

void AiForce::Attack ( const Vec2i pos  ) 

void AiForce::RemoveDeadUnit (  ) 

Ai clean units in a force.

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!
Todo:
transporter are more selective now (flag with unittypeland). We must manage it.

void AiForce::ReturnToHome (  ) 


Friends And Related Function Documentation

friend class AiForceManager [friend]


Member Data Documentation

Flag saying force is complete build.

Flag saying force is defending.

Flag saying force is attacking.

Role of the force.

Count and types of unit-type.

Attack state.

Attack point 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.