_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          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 | List of all members
COrder Class Referenceabstract

#include <actions.h>

Inheritance diagram for COrder:
COrder_Attack COrder_Board COrder_Build COrder_Built COrder_Defend COrder_Die COrder_Explore COrder_Follow COrder_Move COrder_Patrol COrder_Repair COrder_Research COrder_Resource COrder_SpellCast COrder_Still COrder_Train COrder_TransformInto COrder_Unload COrder_UpgradeTo

Public Member Functions

 COrder (int action)
 
virtual COrderClone () const =0
 
virtual void Execute (CUnit &unit)=0
 
virtual void Cancel (CUnit &unit)
 
virtual bool IsValid () const =0
 
virtual PixelPos Show (const CViewport &vp, const PixelPos &lastScreenPos) const =0
 
virtual void Save (CFile &file, const CUnit &unit) const =0
 
virtual bool ParseSpecificData (lua_State *l, int &j, const char *value, const CUnit &unit)=0
 
virtual void UpdateUnitVariables (CUnit &unit) const
 
virtual void UpdatePathFinderData (PathFinderInput &input)=0
 
bool HasGoal () const
 
CUnitGetGoal () const
 
script_unit.cpp - The unit ccl functions.
bool ParseGenericData (lua_State *l, int &j, const char *value)
 

Static Public Member Functions

action_attack.cpp - The attack action.
static COrderNewActionAttack (const CUnit &attacker, CUnit &target)
 
static COrderNewActionAttack (const CUnit &attacker, const Vec2i &dest)
 
static COrderNewActionAttackGround (const CUnit &attacker, const Vec2i &dest)
 
action_board.cpp - The board action.
static COrderNewActionBoard (CUnit &unit)
 
action_build.cpp - The build building action.
static COrderNewActionBuild (const CUnit &builder, const Vec2i &pos, CUnitType &building)
 
action_build.cpp - The build building action.
static COrderNewActionBuilt (CUnit &builder, CUnit &unit)
 
action_defend.cpp - The defend action.
static COrderNewActionDefend (CUnit &dest)
 
action_die.cpp - The die action.
static COrderNewActionDie ()
 
action_explore.cpp - The explore action.
static COrderNewActionExplore (const CUnit &unit)
 
action_follow.cpp - The follow action.
static COrderNewActionFollow (CUnit &dest)
 
action_move.cpp - The move action.
static COrderNewActionMove (const Vec2i &pos)
 
action_patrol.cpp - The patrol action.
static COrderNewActionPatrol (const Vec2i &currentPos, const Vec2i &dest)
 
action_repair.cpp - The repair action.
static COrderNewActionRepair (CUnit &unit, CUnit &target)
 
static COrderNewActionRepair (const Vec2i &pos)
 
action_research.cpp - The research action.
static COrderNewActionResearch (CUnit &unit, CUpgrade &upgrade)
 
action_resource.cpp - The generic resource action.
static COrderNewActionResource (CUnit &harvester, const Vec2i &pos)
 
static COrderNewActionResource (CUnit &harvester, CUnit &mine)
 
static COrderNewActionReturnGoods (CUnit &harvester, CUnit *depot)
 
action_spellcast.cpp - The spell cast action.
static COrderNewActionSpellCast (const SpellType &spell, const Vec2i &pos, CUnit *target, bool isAutocast=false)
 
action_still.cpp - The stand still action.
static COrderNewActionStandGround ()
 
static COrderNewActionStill ()
 
action_train.cpp - The building train action.
static COrderNewActionTrain (CUnit &trainer, CUnitType &type)
 
action_upgradeto.cpp - The unit upgrading to new action.
static COrderNewActionTransformInto (CUnitType &type)
 
static COrderNewActionUpgradeTo (CUnit &unit, CUnitType &type, bool instant=false)
 
action_unload.cpp - The unload action.
static COrderNewActionUnload (const Vec2i &pos, CUnit *what)
 

Public Attributes

const unsigned char Action
 
bool Finished
 global action More...
 
bool Instant
 true when order is finish More...
 

actions.cpp - The actions.

virtual ~COrder ()
 Hash calculated to find sync failures. More...
 
virtual void OnAnimationAttack (CUnit &unit)
 
virtual void FillSeenValues (CUnit &unit) const
 
virtual void AiUnitKilled (CUnit &unit)
 
void SetGoal (CUnit *const new_goal)
 
void ClearGoal ()
 
virtual const Vec2i GetGoalPos () const
 
virtual bool OnAiHitUnit (CUnit &unit, CUnit *attacker, int)
 
void UpdatePathFinderData_NotCalled (PathFinderInput &input)
 

Detailed Description

Unit order structure.

Constructor & Destructor Documentation

◆ COrder()

COrder::COrder ( int  action)
inlineexplicit

◆ ~COrder()

COrder::~COrder ( )
virtual

Hash calculated to find sync failures.

Member Function Documentation

◆ AiUnitKilled()

void COrder::AiUnitKilled ( CUnit unit)
virtual

Called when unit is killed. warn the AI module.

Reimplemented in COrder_Build, and COrder_Built.

◆ Cancel()

virtual void COrder::Cancel ( CUnit unit)
inlinevirtual

◆ ClearGoal()

void COrder::ClearGoal ( )

◆ Clone()

virtual COrder* COrder::Clone ( ) const
pure virtual

◆ Execute()

virtual void COrder::Execute ( CUnit unit)
pure virtual

◆ FillSeenValues()

void COrder::FillSeenValues ( CUnit unit) const
virtual

Reimplemented in COrder_Built.

◆ GetGoal()

CUnit* COrder::GetGoal ( ) const
inline

◆ GetGoalPos()

const Vec2i COrder::GetGoalPos ( ) const
virtual

◆ HasGoal()

bool COrder::HasGoal ( ) const
inline

◆ IsValid()

virtual bool COrder::IsValid ( ) const
pure virtual

◆ NewActionAttack() [1/2]

COrder * COrder::NewActionAttack ( const CUnit attacker,
const Vec2i dest 
)
static

◆ NewActionAttack() [2/2]

COrder * COrder::NewActionAttack ( const CUnit attacker,
CUnit target 
)
static

◆ NewActionAttackGround()

COrder * COrder::NewActionAttackGround ( const CUnit attacker,
const Vec2i dest 
)
static

◆ NewActionBoard()

COrder * COrder::NewActionBoard ( CUnit unit)
static

◆ NewActionBuild()

COrder * COrder::NewActionBuild ( const CUnit builder,
const Vec2i pos,
CUnitType building 
)
static

◆ NewActionBuilt()

COrder * COrder::NewActionBuilt ( CUnit builder,
CUnit unit 
)
static

◆ NewActionDefend()

COrder * COrder::NewActionDefend ( CUnit dest)
static

◆ NewActionDie()

COrder * COrder::NewActionDie ( )
static

◆ NewActionExplore()

COrder * COrder::NewActionExplore ( const CUnit unit)
static

◆ NewActionFollow()

COrder * COrder::NewActionFollow ( CUnit dest)
static

◆ NewActionMove()

COrder * COrder::NewActionMove ( const Vec2i pos)
static

◆ NewActionPatrol()

COrder * COrder::NewActionPatrol ( const Vec2i currentPos,
const Vec2i dest 
)
static

◆ NewActionRepair() [1/2]

COrder * COrder::NewActionRepair ( const Vec2i pos)
static

◆ NewActionRepair() [2/2]

COrder * COrder::NewActionRepair ( CUnit unit,
CUnit target 
)
static

◆ NewActionResearch()

COrder * COrder::NewActionResearch ( CUnit unit,
CUpgrade upgrade 
)
static

◆ NewActionResource() [1/2]

COrder * COrder::NewActionResource ( CUnit harvester,
const Vec2i pos 
)
static

◆ NewActionResource() [2/2]

COrder * COrder::NewActionResource ( CUnit harvester,
CUnit mine 
)
static

◆ NewActionReturnGoods()

COrder * COrder::NewActionReturnGoods ( CUnit harvester,
CUnit depot 
)
static

◆ NewActionSpellCast()

COrder * COrder::NewActionSpellCast ( const SpellType spell,
const Vec2i pos,
CUnit target,
bool  isAutocast = false 
)
static

◆ NewActionStandGround()

COrder * COrder::NewActionStandGround ( )
static

◆ NewActionStill()

COrder * COrder::NewActionStill ( )
static

◆ NewActionTrain()

COrder * COrder::NewActionTrain ( CUnit trainer,
CUnitType type 
)
static

◆ NewActionTransformInto()

COrder * COrder::NewActionTransformInto ( CUnitType type)
static

◆ NewActionUnload()

COrder * COrder::NewActionUnload ( const Vec2i pos,
CUnit what 
)
static

◆ NewActionUpgradeTo()

COrder * COrder::NewActionUpgradeTo ( CUnit unit,
CUnitType type,
bool  instant = false 
)
static

◆ OnAiHitUnit()

bool COrder::OnAiHitUnit ( CUnit unit,
CUnit attacker,
int   
)
virtual

Reimplemented in COrder_Resource, and COrder_Attack.

◆ OnAnimationAttack()

void COrder::OnAnimationAttack ( CUnit unit)
virtual

Call when animation step is "attack"

Reimplemented in COrder_SpellCast, COrder_Attack, and COrder_Still.

◆ ParseGenericData()

bool COrder::ParseGenericData ( lua_State *  l,
int &  j,
const char *  value 
)

◆ ParseSpecificData()

virtual bool COrder::ParseSpecificData ( lua_State *  l,
int &  j,
const char *  value,
const CUnit unit 
)
pure virtual

◆ Save()

virtual void COrder::Save ( CFile file,
const CUnit unit 
) const
pure virtual

◆ SetGoal()

void COrder::SetGoal ( CUnit *const  new_goal)

◆ Show()

virtual PixelPos COrder::Show ( const CViewport vp,
const PixelPos lastScreenPos 
) const
pure virtual

◆ UpdatePathFinderData()

virtual void COrder::UpdatePathFinderData ( PathFinderInput input)
pure virtual

◆ UpdatePathFinderData_NotCalled()

void COrder::UpdatePathFinderData_NotCalled ( PathFinderInput input)
protected

◆ UpdateUnitVariables()

virtual void COrder::UpdateUnitVariables ( CUnit unit) const
inlinevirtual

Member Data Documentation

◆ Action

const unsigned char COrder::Action

◆ Finished

bool COrder::Finished

global action

◆ Instant

bool COrder::Instant

true when order is finish


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.