$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
00001 // _________ __ __ 00002 // / _____// |_____________ _/ |______ ____ __ __ ______ 00003 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ 00004 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ | 00005 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > 00006 // \/ \/ \//_____/ \/ 00007 // ______________________ ______________________ 00008 // T H E W A R B E G I N S 00009 // Stratagus - A free fantasy real time strategy game engine 00010 // 00012 // 00013 // (c) Copyright 1998-2006 by Lutz Sammer and Jimmy Salmon 00014 // 00015 // This program is free software; you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation; only version 2 of the License. 00018 // 00019 // This program is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 // GNU General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with this program; if not, write to the Free Software 00026 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00027 // 02111-1307, USA. 00028 // 00029 00030 #ifndef __COMMANDS_H__ 00031 #define __COMMANDS_H__ 00032 00034 00035 #include "vec2i.h" 00036 00037 /*---------------------------------------------------------------------------- 00038 -- Declarations 00039 ----------------------------------------------------------------------------*/ 00040 00041 class CUnit; 00042 class CFile; 00043 class SpellType; 00044 class CUnitType; 00045 class CUpgrade; 00046 00047 /*---------------------------------------------------------------------------- 00048 -- Functions 00049 ----------------------------------------------------------------------------*/ 00050 /*---------------------------------------------------------------------------- 00051 -- Commands: in command.c 00052 ----------------------------------------------------------------------------*/ 00053 00059 00060 extern void CommandQuit(int player); 00062 extern void CommandStopUnit(CUnit &unit); 00064 extern void CommandStandGround(CUnit &unit, int flush); 00066 extern void CommandFollow(CUnit &unit, CUnit &dest, int flush); 00068 extern void CommandMove(CUnit &unit, const Vec2i &pos, int flush); 00070 extern void CommandRepair(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush); 00072 extern void CommandAutoRepair(CUnit &unit, int on); 00074 extern void CommandAttack(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush); 00076 extern void CommandAttackGround(CUnit &unit, const Vec2i &pos, int flush); 00078 extern void CommandPatrolUnit(CUnit &unit, const Vec2i &pos, int flush); 00080 extern void CommandBoard(CUnit &unit, CUnit &dest, int flush); 00082 extern void CommandUnload(CUnit &unit, const Vec2i &pos, CUnit *what, int flush); 00084 extern void CommandBuildBuilding(CUnit &unit, const Vec2i &pos, CUnitType &, int flush); 00086 extern void CommandDismiss(CUnit &unit); 00088 extern void CommandResourceLoc(CUnit &unit, const Vec2i &pos, int flush); 00090 extern void CommandResource(CUnit &unit, CUnit &dest, int flush); 00092 extern void CommandReturnGoods(CUnit &unit, CUnit *depot, int flush); 00094 extern void CommandTrainUnit(CUnit &unit, CUnitType &what, int flush); 00096 extern void CommandCancelTraining(CUnit &unit, int slot, const CUnitType *type); 00098 extern void CommandUpgradeTo(CUnit &unit, CUnitType &what, int flush); 00100 extern void CommandTransformIntoType(CUnit &unit, CUnitType &type); 00102 extern void CommandCancelUpgradeTo(CUnit &unit); 00104 extern void CommandResearch(CUnit &unit, CUpgrade &what, int flush); 00106 extern void CommandCancelResearch(CUnit &unit); 00108 extern void CommandSpellCast(CUnit &unit, const Vec2i &pos, CUnit *dest, const SpellType &spell, int flush); 00110 extern void CommandAutoSpellCast(CUnit &unit, int spellid, int on); 00112 extern void CommandDiplomacy(int player, int state, int opponent); 00114 extern void CommandSharedVision(int player, bool state, int opponent); 00115 00116 /* 00117 ** The send command functions sends a command, if needed over the 00118 ** Network, this is only for user commands. Automatic reactions which 00119 ** are on all computers equal, should use the functions without Send. 00120 */ 00121 00125 typedef unsigned short UnitRef; 00126 00128 extern void SendCommandStopUnit(CUnit &unit); 00130 extern void SendCommandStandGround(CUnit &unit, int flush); 00132 extern void SendCommandFollow(CUnit &unit, CUnit &dest, int flush); 00134 extern void SendCommandMove(CUnit &unit, const Vec2i &pos, int flush); 00136 extern void SendCommandRepair(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush); 00138 extern void SendCommandAutoRepair(CUnit &unit, int on); 00140 extern void SendCommandAttack(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush); 00142 extern void SendCommandAttackGround(CUnit &unit, const Vec2i &pos, int flush); 00144 extern void SendCommandPatrol(CUnit &unit, const Vec2i &pos, int flush); 00146 extern void SendCommandBoard(CUnit &unit, CUnit &dest, int flush); 00148 extern void SendCommandUnload(CUnit &unit, const Vec2i &pos, CUnit *what, int flush); 00150 extern void SendCommandBuildBuilding(CUnit &unit, const Vec2i &pos, CUnitType &what, int flush); 00152 extern void SendCommandDismiss(CUnit &unit); 00154 extern void SendCommandResourceLoc(CUnit &unit, const Vec2i &pos, int flush); 00156 extern void SendCommandResource(CUnit &unit, CUnit &dest, int flush); 00158 extern void SendCommandReturnGoods(CUnit &unit, CUnit *dest, int flush); 00160 extern void SendCommandTrainUnit(CUnit &unit, CUnitType &what, int flush); 00162 extern void SendCommandCancelTraining(CUnit &unit, int slot, const CUnitType *type); 00164 extern void SendCommandUpgradeTo(CUnit &unit, CUnitType &what, int flush); 00166 extern void SendCommandCancelUpgradeTo(CUnit &unit); 00168 extern void SendCommandResearch(CUnit &unit, CUpgrade &what, int flush); 00170 extern void SendCommandCancelResearch(CUnit &unit); 00172 extern void SendCommandSpellCast(CUnit &unit, const Vec2i &pos, CUnit *dest, int spellid, int flush); 00174 extern void SendCommandAutoSpellCast(CUnit &unit, int spellid, int on); 00176 extern void SendCommandDiplomacy(int player, int state, int opponent); 00178 extern void SendCommandSharedVision(int player, bool state, int opponent); 00179 00181 extern void ParseCommand(unsigned char type, UnitRef unum, unsigned short x, 00182 unsigned short y, UnitRef dest); 00184 extern void ParseExtendedCommand(unsigned char type, int status, 00185 unsigned char arg1, unsigned short arg2, unsigned short arg3, 00186 unsigned short arg4); 00187 00188 00189 00190 #define FlushCommands 1 00191 00192 00193 00194 #endif // !__COMMANDS_H__