____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

commands.h File Reference

The commands header file. More...

#include "unit.h"

Go to the source code of this file.

Functions

void SendCommandStopUnit (CUnit *unit)
 < Send stop command
void SendCommandStandGround (CUnit *unit, int flush)
 Send follow command.
void SendCommandFollow (CUnit *unit, CUnit *dest, int flush)
 Send move command.
void SendCommandMove (CUnit *unit, int x, int y, int flush)
 Send repair command.
void SendCommandRepair (CUnit *unit, int x, int y, CUnit *dest, int flush)
 Send auto repair command.
void SendCommandAutoRepair (CUnit *unit, int on)
 Send attack command.
void SendCommandAttack (CUnit *unit, int x, int y, CUnit *dest, int flush)
 Send attack ground command.
void SendCommandAttackGround (CUnit *unit, int x, int y, int flush)
 Send patrol command.
void SendCommandPatrol (CUnit *unit, int x, int y, int flush)
 Send board command.
void SendCommandBoard (CUnit *unit, int x, int y, CUnit *dest, int flush)
 Send unload command.
void SendCommandUnload (CUnit *unit, int x, int y, CUnit *what, int flush)
 Send build building command.
void SendCommandBuildBuilding (CUnit *unit, int x, int y, CUnitType *what, int flush)
 Send cancel building command.
void SendCommandDismiss (CUnit *unit)
 Send harvest command.
void SendCommandResource (CUnit *unit, CUnit *dest, int flush)
 Send train command.
void SendCommandTrainUnit (CUnit *unit, CUnitType *what, int flush)
 Send cancel training command.
void SendCommandCancelTraining (CUnit *unit, int slot, const CUnitType *type)
 Send spell cast command.
void SendCommandSpellCast (CUnit *unit, int x, int y, CUnit *dest, int spellid, int flush)
 Send auto spell cast command.
void SendCommandAutoSpellCast (CUnit *unit, int spellid, int on)
 Send diplomacy command.
void SendCommandDiplomacy (int player, int state, int opponent)
 Send shared vision command.
void SendCommandSharedVision (int player, bool state, int opponent)
 Parse a command (from network).
void ParseCommand (unsigned char type, UnitRef unum, unsigned short x, unsigned short y, UnitRef dest)
 Parse an extended command (from network).
void ParseExtendedCommand (unsigned char type, int status, unsigned char arg1, unsigned short arg2, unsigned short arg3, unsigned short arg4)


Detailed Description

The commands header file.

Definition in file commands.h.


Function Documentation

void ParseCommand ( unsigned char  msgnr,
UnitRef  unum,
unsigned short  x,
unsigned short  y,
UnitRef  dstnr 
)

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

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

Definition at line 619 of file commands.cpp.

References _C_, CommandDiplomacy(), CommandLog(), CommandSharedVision(), DebugPrint, DiplomacyAllied, DiplomacyCrazy, DiplomacyEnemy, DiplomacyNeutral, ExtendedMessageDiplomacy, ExtendedMessageSharedVision, and NoUnitP.

Referenced by ParseNetworkCommand().

void SendCommandAttack ( CUnit unit,
int  x,
int  y,
CUnit attack,
int  flush 
)

Send attack ground command.

Send command: Unit attack unit or at position.

Parameters:
unit pointer to unit.
x X map tile position to attack.
y Y map tile position to attack.
attack or !=NoUnitP unit to be attacked.
flush Flag flush all pending commands.

Definition at line 161 of file commands.cpp.

References CommandAttack(), CommandLog(), IsNetworkGame, MessageCommandAttack, and NetworkSendCommand().

Referenced by DoNextReplay(), DoRightButton(), and SendAttack().

void SendCommandAttackGround ( CUnit unit,
int  x,
int  y,
int  flush 
)

Send patrol command.

Send command: Unit attack ground.

Parameters:
unit pointer to unit.
x X map tile position to fire on.
y Y map tile position to fire on.
flush Flag flush all pending commands.

Definition at line 179 of file commands.cpp.

References CommandAttackGround(), CommandLog(), IsNetworkGame, MessageCommandGround, NetworkSendCommand(), and NoUnitP.

Referenced by DoNextReplay(), and SendAttackGround().

void SendCommandAutoRepair ( CUnit unit,
int  on 
)

Send attack command.

Send command: Unit auto repair.

Parameters:
unit pointer to unit.
on 1 for auto repair on, 0 for off.

Definition at line 140 of file commands.cpp.

References CommandAutoRepair(), CommandLog(), FlushCommands, IsNetworkGame, MessageCommandAutoRepair, NetworkSendCommand(), and NoUnitP.

Referenced by CButtonPanel::DoClicked(), and DoNextReplay().

void SendCommandAutoSpellCast ( CUnit unit,
int  spellid,
int  on 
)

Send diplomacy 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.

Definition at line 364 of file commands.cpp.

References CommandAutoSpellCast(), CommandLog(), FlushCommands, IsNetworkGame, MessageCommandSpellCast, NetworkSendCommand(), and NoUnitP.

Referenced by CButtonPanel::DoClicked(), and DoNextReplay().

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

Send unload command.

Send command: Unit board unit.

Parameters:
unit pointer to unit.
x X map tile position (unused).
y Y map tile position (unused).
dest Destination to be boarded.
flush Flag flush all pending commands.

Definition at line 216 of file commands.cpp.

References CommandBoard(), CommandLog(), IsNetworkGame, MessageCommandBoard, and NetworkSendCommand().

Referenced by DoNextReplay(), DoRightButton(), and SendMove().

void SendCommandBuildBuilding ( CUnit unit,
int  x,
int  y,
CUnitType what,
int  flush 
)

Send cancel building command.

Send command: Unit builds building at position.

Parameters:
unit pointer to unit.
x X map tile position of construction.
y Y map tile position of construction.
what pointer to unit-type of the building.
flush Flag flush all pending commands.

Definition at line 254 of file commands.cpp.

References CommandBuildBuilding(), CommandLog(), CUnitType::Ident, IsNetworkGame, MessageCommandBuild, NetworkSendCommand(), and NoUnitP.

Referenced by DoNextReplay(), and UIHandleButtonDown().

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

Send spell cast command.

Send command: Cancel training.

Parameters:
unit Pointer to unit.
slot Slot of training queue to cancel.
type Unit-type of unit to cancel.

Definition at line 323 of file commands.cpp.

References CommandCancelTraining(), CommandLog(), FlushCommands, CUnitType::Ident, IsNetworkGame, MessageCommandCancelTrain, NetworkSendCommand(), and NoUnitP.

Referenced by CButtonPanel::DoClicked(), DoNextReplay(), and UIHandleButtonDown().

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

Send shared vision command.

Send command: Diplomacy changed.

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

Definition at line 383 of file commands.cpp.

References CommandDiplomacy(), CommandLog(), DiplomacyAllied, DiplomacyCrazy, DiplomacyEnemy, DiplomacyNeutral, ExtendedMessageDiplomacy, IsNetworkGame, NetworkSendExtendedCommand(), and NoUnitP.

Referenced by CclSetDiplomacy(), and DoNextReplay().

void SendCommandDismiss ( CUnit unit  ) 

Send harvest command.

Send command: Cancel this building construction.

Parameters:
unit pointer to unit.

Definition at line 270 of file commands.cpp.

References CommandDismiss(), CommandLog(), FlushCommands, IsNetworkGame, MessageCommandDismiss, and NetworkSendCommand().

Referenced by CButtonPanel::DoClicked(), and DoNextReplay().

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

Send move command.

Send command: Follow unit to position.

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

Definition at line 87 of file commands.cpp.

References CommandFollow(), CommandLog(), IsNetworkGame, MessageCommandFollow, and NetworkSendCommand().

Referenced by DoNextReplay(), DoRightButton(), and SendMove().

void SendCommandMove ( CUnit unit,
int  x,
int  y,
int  flush 
)

Send repair command.

Send command: Move unit to position.

Parameters:
unit pointer to unit.
x X map tile position to move to.
y Y map tile position to move to.
flush Flag flush all pending commands.

Definition at line 105 of file commands.cpp.

References CommandLog(), CommandMove(), IsNetworkGame, MessageCommandMove, NetworkSendCommand(), and NoUnitP.

Referenced by DoNextReplay(), DoRightButton(), SendAttack(), SendAttackGround(), SendMove(), and SendResource().

void SendCommandPatrol ( CUnit unit,
int  x,
int  y,
int  flush 
)

Send board command.

Send command: Unit patrol between current and position.

Parameters:
unit pointer to unit.
x X map tile position to patrol between.
y Y map tile position to patrol between.
flush Flag flush all pending commands.

Definition at line 197 of file commands.cpp.

References CommandLog(), CommandPatrolUnit(), IsNetworkGame, MessageCommandPatrol, NetworkSendCommand(), and NoUnitP.

Referenced by DoNextReplay(), and SendPatrol().

void SendCommandRepair ( CUnit unit,
int  x,
int  y,
CUnit dest,
int  flush 
)

Send auto repair command.

Send command: Unit repair.

Parameters:
unit Pointer to unit.
x X map tile position to repair.
y Y map tile position to repair.
dest Unit to be repaired.
flush Flag flush all pending commands.

Definition at line 124 of file commands.cpp.

References CommandLog(), CommandRepair(), IsNetworkGame, MessageCommandRepair, and NetworkSendCommand().

Referenced by DoNextReplay(), DoRightButton(), and SendRepair().

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

Send train 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.

Definition at line 289 of file commands.cpp.

References CommandLog(), CommandResource(), IsNetworkGame, MessageCommandResource, and NetworkSendCommand().

Referenced by DoNextReplay(), DoRightButton(), and SendResource().

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

Parse a command (from network).

Send command: Shared vision changed.

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

Definition at line 418 of file commands.cpp.

References CommandLog(), CommandSharedVision(), ExtendedMessageSharedVision, IsNetworkGame, NetworkSendExtendedCommand(), and NoUnitP.

Referenced by CclSetSharedVision(), and DoNextReplay().

void SendCommandSpellCast ( CUnit unit,
int  x,
int  y,
CUnit dest,
int  spellid,
int  flush 
)

Send auto spell cast command.

Send command: Unit spell cast on position/unit.

Parameters:
unit pointer to unit.
x X map tile position where to cast spell.
y Y map tile position where to cast spell.
dest Cast spell on unit (if exist).
spellid Spell type id.
flush Flag flush all pending commands.

Definition at line 345 of file commands.cpp.

References CommandLog(), CommandSpellCast(), IsNetworkGame, MessageCommandSpellCast, NetworkSendCommand(), and SpellTypeTable.

Referenced by DoNextReplay(), DoRightButton(), and SendSpellCast().

void SendCommandStandGround ( CUnit unit,
int  flush 
)

Send follow command.

Send command: Unit stand ground.

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

Definition at line 70 of file commands.cpp.

References CommandLog(), CommandStandGround(), IsNetworkGame, MessageCommandStand, NetworkSendCommand(), and NoUnitP.

Referenced by CButtonPanel::DoClicked(), and DoNextReplay().

void SendCommandStopUnit ( CUnit unit  ) 

< Send stop command

Send stand ground command

Send command: Unit stop.

Parameters:
unit pointer to unit.

Definition at line 54 of file commands.cpp.

References CommandLog(), CommandStopUnit(), FlushCommands, IsNetworkGame, MessageCommandStop, NetworkSendCommand(), and NoUnitP.

Referenced by CButtonPanel::DoClicked(), DoNextReplay(), DoRightButton(), and SendMove().

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

Send cancel training 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.

Definition at line 306 of file commands.cpp.

References CommandLog(), CommandTrainUnit(), CUnitType::Ident, IsNetworkGame, MessageCommandTrain, NetworkSendCommand(), and NoUnitP.

Referenced by CButtonPanel::DoClicked(), and DoNextReplay().

void SendCommandUnload ( CUnit unit,
int  x,
int  y,
CUnit what,
int  flush 
)

Send build building command.

Send command: Unit unload unit.

Parameters:
unit pointer to unit.
x X map tile position of unload.
y Y map tile position of unload.
what Passagier to be unloaded.
flush Flag flush all pending commands.

Definition at line 235 of file commands.cpp.

References CommandLog(), CommandUnload(), IsNetworkGame, MessageCommandUnload, and NetworkSendCommand().

Referenced by CButtonPanel::DoClicked(), DoNextReplay(), SendUnload(), and UIHandleButtonDown().


Generated on Sat Feb 21 00:28:16 2009 for Bos Wars by  doxygen 1.5.6