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

src/include/commands.h File Reference

#include "unit.h"

Go to the source code of this file.


Functions

commands.h - The commands header file.
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 SendCommandSetResource (int player, int resource, int value)
 Send set resource 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).

Function Documentation

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).

Parameters:
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).

Parameters:
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

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 SendCommandAutoRepair ( CUnit unit,
int  on 
)

Send auto repair command.

Send command: Unit auto repair.

Parameters:
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.

Parameters:
unit pointer to unit.
spellid Spell type id.
on 1 for auto cast on, 0 for off.

void SendCommandBoard ( CUnit unit,
CUnit dest,
int  flush 
)

Send board command.

Send command: Unit board unit.

Parameters:
unit pointer to unit.
dest Destination to be boarded.
flush Flag flush all pending commands.

void SendCommandBuildBuilding ( CUnit unit,
const Vec2i pos,
CUnitType what,
int  flush 
)

Send build building command.

void SendCommandCancelResearch ( CUnit unit  ) 

Send cancel research command.

Send command: Cancel Building/unit research.

Parameters:
unit pointer to unit.

void SendCommandCancelTraining ( CUnit unit,
int  slot,
const CUnitType type 
)

Send cancel training command.

Send command: Cancel training.

Parameters:
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.

Parameters:
unit Pointer to unit.

void SendCommandDiplomacy ( int  player,
int  state,
int  opponent 
)

Send diplomacy command.

Send command: Diplomacy changed.

Parameters:
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.

Parameters:
unit pointer to unit.

void SendCommandFollow ( CUnit unit,
CUnit dest,
int  flush 
)

Send follow command.

Send command: Follow unit to position.

Parameters:
unit pointer to unit.
dest follow this unit.
flush Flag flush all pending commands.

void SendCommandMove ( CUnit unit,
const Vec2i pos,
int  flush 
)

Send move command.

void SendCommandPatrol ( CUnit unit,
const Vec2i pos,
int  flush 
)

Send patrol command.

void SendCommandRepair ( CUnit unit,
const Vec2i pos,
CUnit dest,
int  flush 
)

Send repair command.

void SendCommandResearch ( CUnit unit,
CUpgrade what,
int  flush 
)

Send research command.

Send command: Building/unit research.

Parameters:
unit pointer to unit.
what research-type of the research.
flush Flag flush all pending commands.

void SendCommandResource ( CUnit unit,
CUnit dest,
int  flush 
)

Send harvest command.

Send command: Unit harvest resources

Parameters:
unit pointer to unit.
dest pointer to destination (oil-platform,gold mine).
flush Flag flush all pending commands.

void SendCommandResourceLoc ( CUnit unit,
const Vec2i pos,
int  flush 
)

Send harvest location command.

void SendCommandReturnGoods ( CUnit unit,
CUnit goal,
int  flush 
)

Send return goods command.

Send command: Unit return goods.

Parameters:
unit pointer to unit.
goal pointer to destination of the goods. (NULL=search best)
flush Flag flush all pending commands.

void SendCommandSetResource ( int  player,
int  resource,
int  value 
)

Send set resource command.

Send command: Diplomacy changed.

Parameters:
player Player which changes his resource.
resource Resource type.
value New resource value.

void SendCommandSharedVision ( int  player,
bool  state,
int  opponent 
)

Send shared vision command.

Send command: Shared vision changed.

Parameters:
player Player which changes his state.
state New shared vision state.
opponent Opponent.

void SendCommandSpellCast ( CUnit unit,
const Vec2i pos,
CUnit dest,
int  spellid,
int  flush 
)

Send spell cast command.

void SendCommandStandGround ( CUnit unit,
int  flush 
)

Send stand ground command.

Send command: Unit stand ground.

Parameters:
unit pointer to unit.
flush Flag flush all pending commands.

void SendCommandStopUnit ( CUnit unit  ) 

Send stop command.

Send command: Unit stop.

Parameters:
unit pointer to unit.

void SendCommandTrainUnit ( CUnit unit,
CUnitType what,
int  flush 
)

Send train command.

Send command: Building/unit train new unit.

Parameters:
unit pointer to unit.
what pointer to unit-type of the unit to be trained.
flush Flag flush all pending commands.

void SendCommandUnload ( CUnit unit,
const Vec2i pos,
CUnit what,
int  flush 
)

Send unload command.

void SendCommandUpgradeTo ( CUnit unit,
CUnitType what,
int  flush 
)

Send upgrade to command.

Send command: Building starts upgrading to.

Parameters:
unit pointer to unit.
what pointer to unit-type of the unit upgrade.
flush Flag flush all pending commands.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.