_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "stratagus.h"
#include "actions.h"
#include "action/action_built.h"
#include "action/action_build.h"
#include "action/action_research.h"
#include "action/action_train.h"
#include "action/action_upgradeto.h"
#include "commands.h"
#include "map.h"
#include "pathfinder.h"
#include "player.h"
#include "spells.h"
#include "translate.h"
#include "upgrade.h"
#include "ui.h"
#include "unit.h"
#include "unit_manager.h"
#include "unittype.h"
Functions | |
command.cpp - Give units a command. | |
static void | ReleaseOrders (CUnit &unit) |
static COrderPtr * | GetNextOrder (CUnit &unit, int flush) |
static void | RemoveOrder (CUnit &unit, unsigned int order) |
static void | ClearNewAction (CUnit &unit) |
static void | ClearSavedAction (CUnit &unit) |
static bool | IsUnitValidForNetwork (const CUnit &unit) |
void | CommandStopUnit (CUnit &unit) |
Prepare command stop. More... | |
void | CommandStandGround (CUnit &unit, int flush) |
Prepare command stand ground. More... | |
void | CommandDefend (CUnit &unit, CUnit &dest, int flush) |
Prepare command defend. More... | |
void | CommandFollow (CUnit &unit, CUnit &dest, int flush) |
Prepare command follow. More... | |
void | CommandMove (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command move. More... | |
void | CommandRepair (CUnit &unit, const Vec2i &pos, CUnit *dest, int flush) |
Prepare command repair. More... | |
void | CommandAutoRepair (CUnit &unit, int on) |
Send auto repair command. More... | |
void | CommandAttack (CUnit &unit, const Vec2i &pos, CUnit *target, int flush) |
Prepare command attack. More... | |
void | CommandAttackGround (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command attack ground. More... | |
void | CommandPatrolUnit (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command patrol. More... | |
void | CommandBoard (CUnit &unit, CUnit &dest, int flush) |
Prepare command board. More... | |
void | CommandUnload (CUnit &unit, const Vec2i &pos, CUnit *what, int flush) |
Prepare command unload. More... | |
void | CommandBuildBuilding (CUnit &unit, const Vec2i &pos, CUnitType &what, int flush) |
Prepare command build. More... | |
void | CommandExplore (CUnit &unit, int flush) |
Prepare command explore. More... | |
void | CommandDismiss (CUnit &unit) |
Prepare command dismiss. More... | |
void | CommandResourceLoc (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command resource location. More... | |
void | CommandResource (CUnit &unit, CUnit &dest, int flush) |
Prepare command resource. More... | |
void | CommandReturnGoods (CUnit &unit, CUnit *depot, int flush) |
Prepare command return. More... | |
void | CommandTrainUnit (CUnit &unit, CUnitType &type, int) |
Prepare command train. More... | |
void | CommandCancelTraining (CUnit &unit, int slot, const CUnitType *type) |
Prepare command cancel training. More... | |
void | CommandUpgradeTo (CUnit &unit, CUnitType &type, int flush, bool instant) |
Prepare command upgrade to. More... | |
void | CommandTransformIntoType (CUnit &unit, CUnitType &type) |
immediate transforming into type. More... | |
void | CommandCancelUpgradeTo (CUnit &unit) |
Prepare command cancel upgrade to. More... | |
void | CommandResearch (CUnit &unit, CUpgrade &what, int flush) |
Prepare command research. More... | |
void | CommandCancelResearch (CUnit &unit) |
Prepare command cancel research. More... | |
void | CommandSpellCast (CUnit &unit, const Vec2i &pos, CUnit *dest, const SpellType &spell, int flush, bool isAutocast) |
Prepare command spellcast. More... | |
void | CommandAutoSpellCast (CUnit &unit, int spellid, int on) |
Prepare command auto spellcast. More... | |
void | CommandDiplomacy (int player, int state, int opponent) |
Prepare diplomacy command. More... | |
void | CommandSharedVision (int playerIndex, bool state, int opponentIndex) |
Prepare shared vision command. More... | |
void | CommandQuit (int player) |
Prepare command quit. More... | |
Clear the saved action.
unit | Unit pointer, that get the saved action cleared. |
Prepare command attack.
Attack with unit at new position
unit | pointer to unit. |
pos | map position to attack. |
target | or unit to be attacked. |
flush | if true, flush command queue. |
Prepare command attack ground.
Attack ground with unit.
unit | pointer to unit. |
pos | map position to fire on. |
flush | if true, flush command queue. |
Send auto repair command.
Auto repair.
unit | pointer to unit. |
on | 1 for auto repair on, 0 for off. |
Prepare command auto spellcast.
Auto spell cast.
unit | pointer to unit. |
spellid | Spell id. |
on | 1 for auto cast on, 0 for off. |
Prepare command board.
Board a transporter with unit.
unit | pointer to unit. |
dest | unit to be boarded. |
flush | if true, flush command queue. |
Prepare command build.
Send a unit building
unit | pointer to unit. |
pos | map position to build. |
what | Unit type to build. |
flush | if true, flush command queue. |
Prepare command cancel research.
Cancel Building researching.
unit | Pointer to unit. |
Prepare command cancel training.
Cancel the training of an unit.
unit | pointer to unit. |
slot | slot number to cancel. |
type | Unit-type to cancel. |
Prepare command cancel upgrade to.
Cancel building upgrading to.
unit | pointer to unit. |
Prepare command defend.
Follow unit and defend it
unit | pointer to unit. |
dest | unit to follow |
flush | if true, flush command queue. |
void CommandDiplomacy | ( | int | player, |
int | state, | ||
int | opponent | ||
) |
Prepare diplomacy command.
Diplomacy changed.
player | Player which changes his state. |
state | New diplomacy state. |
opponent | Opponent. |
Prepare command dismiss.
Cancel the building construction, or kill a unit.
unit | pointer to unit. |
Prepare command explore.
Send a unit exploring
unit | pointer to unit. |
flush | if true, flush command queue. |
Prepare command follow.
Follow unit to new position
unit | pointer to unit. |
dest | unit to be followed |
flush | if true, flush command queue. |
Prepare command move.
Move unit to new position
unit | pointer to unit. |
pos | map position to move to. |
flush | if true, flush command queue. |
Prepare command patrol.
Let a unit patrol from current to new position
FIXME: want to support patroling between units.
unit | pointer to unit. |
pos | map position to patrol between. |
flush | if true, flush command queue. |
void CommandQuit | ( | int | player | ) |
Prepare command quit.
Player quit.
player | Player number that quit. |
Prepare command repair.
Repair unit
unit | pointer to unit. |
pos | map position to repair. |
dest | or unit to be repaired. FIXME: not supported |
flush | if true, flush command queue. |
Prepare command research.
Building starts researching.
unit | pointer to unit. |
what | what to research. |
flush | if true, flush command queue. |
Prepare command resource.
Send unit to harvest resources
unit | pointer to unit. |
dest | destination unit. |
flush | if true, flush command queue. |
Prepare command resource location.
Send unit harvest a location
unit | pointer to unit. |
pos | map position for harvest. |
flush | if true, flush command queue. |
Prepare command return.
Let unit returning goods.
unit | pointer to unit. |
depot | bring goods to this depot. |
flush | if true, flush command queue. |
void CommandSharedVision | ( | int | playerIndex, |
bool | state, | ||
int | opponentIndex | ||
) |
Prepare shared vision command.
Shared vision changed.
playerIndex | Player which changes his state. |
state | New shared vision state. |
opponentIndex | Opponent. |
TODO: change ThisPlayer to currently rendered player/players #RenderTargets
void CommandSpellCast | ( | CUnit & | unit, |
const Vec2i & | pos, | ||
CUnit * | dest, | ||
const SpellType & | spell, | ||
int | flush, | ||
bool | isAutocast | ||
) |
Prepare command spellcast.
Cast a spell at position or unit.
unit | Pointer to unit. |
pos | map position to spell cast on. |
dest | Spell cast on unit (if exist). |
spell | Spell type pointer. |
flush | If true, flush command queue. |
Prepare command stand ground.
Stand ground.
unit | pointer to unit. |
flush | if true, flush command queue. |
Prepare command stop.
Stop unit.
unit | pointer to unit. |
Prepare command train.
Building starts training an unit.
unit | pointer to unit. |
type | unit type to train. |
flush | if true, flush command queue. |
immediate transforming into type.
Immediate transforming unit into type.
unit | pointer to unit. |
type | upgrade to type |
Prepare command unload.
Unload a transporter.
unit | pointer to unit. |
pos | map position to unload. |
what | unit to be unloaded, NULL for all. |
flush | if true, flush command queue. |
Prepare command upgrade to.
Building starts upgrading to.
unit | pointer to unit. |
type | upgrade to type |
flush | if true, flush command queue. |
Get next free order slot.
unit | pointer to unit. |
flush | if true, flush order queue. |
|
static |
Release all orders of a unit.
unit | Pointer to unit. |