$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
#include "vec2i.h"
Go to the source code of this file.
commands.h - The commands header file. | |
#define | FlushCommands 1 |
typedef unsigned short | UnitRef |
void | CommandQuit (int player) |
Prepare command quit. | |
void | CommandStopUnit (CUnit &unit) |
Prepare command stop. | |
void | CommandStandGround (CUnit &unit, int flush) |
Prepare command stand ground. | |
void | CommandFollow (CUnit &unit, CUnit &dest, int flush) |
Prepare command follow. | |
void | CommandMove (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command move. | |
void | CommandRepair (CUnit &unit, const Vec2i &pos, CUnit *dest, int flush) |
Prepare command repair. | |
void | CommandAutoRepair (CUnit &unit, int on) |
Send auto repair command. | |
void | CommandAttack (CUnit &unit, const Vec2i &pos, CUnit *dest, int flush) |
Prepare command attack. | |
void | CommandAttackGround (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command attack ground. | |
void | CommandPatrolUnit (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command patrol. | |
void | CommandBoard (CUnit &unit, CUnit &dest, int flush) |
Prepare command board. | |
void | CommandUnload (CUnit &unit, const Vec2i &pos, CUnit *what, int flush) |
Prepare command unload. | |
void | CommandBuildBuilding (CUnit &unit, const Vec2i &pos, CUnitType &, int flush) |
Prepare command build. | |
void | CommandDismiss (CUnit &unit) |
Prepare command dismiss. | |
void | CommandResourceLoc (CUnit &unit, const Vec2i &pos, int flush) |
Prepare command resource location. | |
void | CommandResource (CUnit &unit, CUnit &dest, int flush) |
Prepare command resource. | |
void | CommandReturnGoods (CUnit &unit, CUnit *depot, int flush) |
Prepare command return. | |
void | CommandTrainUnit (CUnit &unit, CUnitType &what, int flush) |
Prepare command train. | |
void | CommandCancelTraining (CUnit &unit, int slot, const CUnitType *type) |
Prepare command cancel training. | |
void | CommandUpgradeTo (CUnit &unit, CUnitType &what, int flush) |
Prepare command upgrade to. | |
void | CommandTransformIntoType (CUnit &unit, CUnitType &type) |
immediate transforming into type. | |
void | CommandCancelUpgradeTo (CUnit &unit) |
Prepare command cancel upgrade to. | |
void | CommandResearch (CUnit &unit, CUpgrade &what, int flush) |
Prepare command research. | |
void | CommandCancelResearch (CUnit &unit) |
Prepare command cancel research. | |
void | CommandSpellCast (CUnit &unit, const Vec2i &pos, CUnit *dest, const SpellType &spell, int flush) |
Prepare command spellcast. | |
void | CommandAutoSpellCast (CUnit &unit, int spellid, int on) |
Prepare command auto spellcast. | |
void | CommandDiplomacy (int player, int state, int opponent) |
Prepare diplomacy command. | |
void | CommandSharedVision (int player, bool state, int opponent) |
Prepare shared vision command. | |
void | SendCommandStopUnit (CUnit &unit) |
Send stop command. | |
void | SendCommandStandGround (CUnit &unit, int flush) |
Send stand ground command. | |
void | SendCommandFollow (CUnit &unit, CUnit &dest, int flush) |
Send follow command. | |
void | SendCommandMove (CUnit &unit, const Vec2i &pos, int flush) |
Send move command. | |
void | SendCommandRepair (CUnit &unit, const Vec2i &pos, CUnit *dest, int flush) |
Send repair command. | |
void | SendCommandAutoRepair (CUnit &unit, int on) |
Send auto repair command. | |
void | SendCommandAttack (CUnit &unit, const Vec2i &pos, CUnit *dest, int flush) |
Send attack command. | |
void | SendCommandAttackGround (CUnit &unit, const Vec2i &pos, int flush) |
Send attack ground command. | |
void | SendCommandPatrol (CUnit &unit, const Vec2i &pos, int flush) |
Send patrol command. | |
void | SendCommandBoard (CUnit &unit, CUnit &dest, int flush) |
Send board command. | |
void | SendCommandUnload (CUnit &unit, const Vec2i &pos, CUnit *what, int flush) |
Send unload command. | |
void | SendCommandBuildBuilding (CUnit &unit, const Vec2i &pos, CUnitType &what, int flush) |
Send build building command. | |
void | SendCommandDismiss (CUnit &unit) |
Send cancel building command. | |
void | SendCommandResourceLoc (CUnit &unit, const Vec2i &pos, int flush) |
Send harvest location command. | |
void | SendCommandResource (CUnit &unit, CUnit &dest, int flush) |
Send harvest command. | |
void | SendCommandReturnGoods (CUnit &unit, CUnit *dest, int flush) |
Send return goods command. | |
void | SendCommandTrainUnit (CUnit &unit, CUnitType &what, int flush) |
Send train command. | |
void | SendCommandCancelTraining (CUnit &unit, int slot, const CUnitType *type) |
Send cancel training command. | |
void | SendCommandUpgradeTo (CUnit &unit, CUnitType &what, int flush) |
Send upgrade to command. | |
void | SendCommandCancelUpgradeTo (CUnit &unit) |
Send cancel upgrade to command. | |
void | SendCommandResearch (CUnit &unit, CUpgrade &what, int flush) |
Send research command. | |
void | SendCommandCancelResearch (CUnit &unit) |
Send cancel research command. | |
void | SendCommandSpellCast (CUnit &unit, const Vec2i &pos, CUnit *dest, int spellid, int flush) |
Send spell cast command. | |
void | SendCommandAutoSpellCast (CUnit &unit, int spellid, int on) |
Send auto spell cast command. | |
void | SendCommandDiplomacy (int player, int state, int opponent) |
Send diplomacy command. | |
void | SendCommandSharedVision (int player, bool state, int opponent) |
Send shared vision command. | |
void | ParseCommand (unsigned char type, UnitRef unum, unsigned short x, unsigned short y, UnitRef dest) |
Parse a command (from network). | |
void | ParseExtendedCommand (unsigned char type, int status, unsigned char arg1, unsigned short arg2, unsigned short arg3, unsigned short arg4) |
Parse an extended command (from network). |
#define FlushCommands 1 |
typedef unsigned short UnitRef |
Unit references over network, or for memory saving.
Prepare command attack.
Prepare command attack ground.
void CommandAutoRepair | ( | CUnit & | unit, | |
int | on | |||
) |
Send auto repair command.
Auto repair.
unit | pointer to unit. | |
on | 1 for auto repair on, 0 for off. |
void CommandAutoSpellCast | ( | CUnit & | unit, | |
int | spellid, | |||
int | on | |||
) |
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.
void CommandCancelResearch | ( | CUnit & | unit | ) |
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. |
void CommandCancelUpgradeTo | ( | CUnit & | unit | ) |
Prepare command cancel upgrade to.
Cancel building upgrading to.
unit | pointer to unit. |
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. |
void CommandDismiss | ( | CUnit & | unit | ) |
Prepare command dismiss.
Cancel the building construction, or kill a unit.
unit | pointer to unit. |
Prepare command follow.
Follow unit to new position
unit | pointer to unit. | |
dest | unit to be followed | |
flush | if true, flush command queue. |
void CommandQuit | ( | int | player | ) |
Prepare command quit.
This function gives a unit a new command. If the command is given by the user the function with Send prefix should be used.
Player quit.
player | Player number that quit. |
Prepare command repair.
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.
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 | player, | |
bool | state, | |||
int | opponent | |||
) |
Prepare shared vision command.
Shared vision changed.
player | Player which changes his state. | |
state | New shared vision state. | |
opponent | Opponent. |
void CommandSpellCast | ( | CUnit & | unit, | |
const Vec2i & | pos, | |||
CUnit * | dest, | |||
const SpellType & | spell, | |||
int | flush | |||
) |
Prepare command spellcast.
void CommandStandGround | ( | CUnit & | unit, | |
int | flush | |||
) |
Prepare command stand ground.
Stand ground.
unit | pointer to unit. | |
flush | if true, flush command queue. |
void CommandStopUnit | ( | CUnit & | unit | ) |
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.
Prepare command upgrade to.
Building starts upgrading to.
unit | pointer to unit. | |
type | upgrade to type | |
flush | if true, flush command queue. |
void ParseCommand | ( | unsigned char | msgnr, | |
UnitRef | unum, | |||
unsigned short | x, | |||
unsigned short | y, | |||
UnitRef | dstnr | |||
) |
Parse a command (from network).
Parse a command (from network).
msgnr | Network message type | |
unum | Unit number (slot) that receive the command. | |
x | optional X map position. | |
y | optional y map position. | |
dstnr | optional destination unit. |
void ParseExtendedCommand | ( | unsigned char | type, | |
int | status, | |||
unsigned char | arg1, | |||
unsigned short | arg2, | |||
unsigned short | arg3, | |||
unsigned short | arg4 | |||
) |
Parse an extended command (from network).
Parse an extended command (from network).
type | Network extended message type | |
status | Bit 7 of message type | |
arg1 | Messe argument 1 | |
arg2 | Messe argument 2 | |
arg3 | Messe argument 3 | |
arg4 | Messe argument 4 |
Send attack command.
Send attack ground command.
void SendCommandAutoRepair | ( | CUnit & | unit, | |
int | on | |||
) |
Send auto repair command.
Send command: Unit auto repair.
unit | pointer to unit. | |
on | 1 for auto repair on, 0 for off. |
void SendCommandAutoSpellCast | ( | CUnit & | unit, | |
int | spellid, | |||
int | on | |||
) |
Send auto spell cast command.
Send command: Unit auto spell cast.
unit | pointer to unit. | |
spellid | Spell type id. | |
on | 1 for auto cast on, 0 for off. |
Send board command.
Send command: Unit board unit.
unit | pointer to unit. | |
dest | Destination to be boarded. | |
flush | Flag flush all pending commands. |
Send build building command.
void SendCommandCancelResearch | ( | CUnit & | unit | ) |
Send cancel research command.
Send command: Cancel Building/unit research.
unit | pointer to unit. |
Send cancel training command.
Send command: Cancel training.
unit | Pointer to unit. | |
slot | Slot of training queue to cancel. | |
type | Unit-type of unit to cancel. |
void SendCommandCancelUpgradeTo | ( | CUnit & | unit | ) |
Send cancel upgrade to command.
Send command: Cancel building upgrading to.
unit | Pointer to unit. |
void SendCommandDiplomacy | ( | int | player, | |
int | state, | |||
int | opponent | |||
) |
Send diplomacy command.
Send command: Diplomacy changed.
player | Player which changes his state. | |
state | New diplomacy state. | |
opponent | Opponent. |
void SendCommandDismiss | ( | CUnit & | unit | ) |
Send cancel building command.
Send command: Cancel this building construction.
unit | pointer to unit. |
Send follow command.
Send command: Follow unit to position.
unit | pointer to unit. | |
dest | follow this unit. | |
flush | Flag flush all pending commands. |
Send repair command.
Send research command.
Send command: Building/unit research.
unit | pointer to unit. | |
what | research-type of the research. | |
flush | Flag flush all pending commands. |
Send harvest command.
Send command: Unit harvest resources
unit | pointer to unit. | |
dest | pointer to destination (oil-platform,gold mine). | |
flush | Flag flush all pending commands. |
Send harvest location command.
Send return goods command.
Send command: Unit return goods.
unit | pointer to unit. | |
goal | pointer to destination of the goods. (NULL=search best) | |
flush | Flag flush all pending commands. |
void SendCommandSharedVision | ( | int | player, | |
bool | state, | |||
int | opponent | |||
) |
Send shared vision command.
Send command: Shared vision changed.
player | Player which changes his state. | |
state | New shared vision state. | |
opponent | Opponent. |
Send spell cast command.
void SendCommandStandGround | ( | CUnit & | unit, | |
int | flush | |||
) |
Send stand ground command.
Send command: Unit stand ground.
unit | pointer to unit. | |
flush | Flag flush all pending commands. |
void SendCommandStopUnit | ( | CUnit & | unit | ) |
Send stop command.
Send command: Unit stop.
unit | pointer to unit. |
Send train command.
Send command: Building/unit train new unit.
unit | pointer to unit. | |
what | pointer to unit-type of the unit to be trained. | |
flush | Flag flush all pending commands. |
Send unload command.
Send upgrade to command.
Send command: Building starts upgrading to.
unit | pointer to unit. | |
what | pointer to unit-type of the unit upgrade. | |
flush | Flag flush all pending commands. |