____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#include "stratagus.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#include <map>
#include "upgrade.h"
#include "player.h"
#include "interface.h"
#include "map.h"
#include "script.h"
#include "spells.h"
#include "unit.h"
#include "unittype.h"
#include "actions.h"
#include "iolib.h"
Go to the source code of this file.
Functions | |
| static void | AllowUnitId (CPlayer *player, int id, int units) |
| void | SaveUpgrades (CFile *file) |
| < save the upgrades | |
| static int | CclDefineUnitAllow (lua_State *l) |
| static int | CclDefineAllow (lua_State *l) |
| void | UpgradesCclRegister (void) |
| int | UnitTypeIdByIdent (const std::string &ident) |
| int | UnitIdAllowed (const CPlayer *player, int id) |
Definition in file upgrade.cpp.
| static void AllowUnitId | ( | CPlayer * | player, | |
| int | id, | |||
| int | units | |||
| ) | [static] |
Change allow for a unit-type.
| player | Player to change | |
| id | unit type id | |
| units | maximum amount of units allowed |
Definition at line 213 of file upgrade.cpp.
References CPlayer::Allow, and CAllow::Units.
Referenced by CclDefineAllow(), and CclDefineUnitAllow().
| static int CclDefineAllow | ( | lua_State * | l | ) | [static] |
Define which units/upgrades are allowed.
Definition at line 129 of file upgrade.cpp.
References _C_, AllowUnitId(), DebugPrint, LuaToString(), PlayerMax, Players, UnitMax, and UnitTypeIdByIdent().
Referenced by UpgradesCclRegister().
| static int CclDefineUnitAllow | ( | lua_State * | l | ) | [static] |
Define which units are allowed and how much.
Definition at line 98 of file upgrade.cpp.
References _C_, AllowUnitId(), DebugPrint, LuaToNumber(), LuaToString(), PlayerMax, Players, and UnitTypeIdByIdent().
Referenced by UpgradesCclRegister().
| void SaveUpgrades | ( | CFile * | file | ) |
< save the upgrades
Save state of the dependencies to file.
| file | Output file. |
Definition at line 70 of file upgrade.cpp.
References PlayerMax, Players, CFile::printf(), CPlayer::Units, and UnitTypes.
Referenced by SaveGame().
| int UnitIdAllowed | ( | const CPlayer * | player, | |
| int | id | |||
| ) |
Return the allow state of the unit.
| player | Check state of this player. | |
| id | Unit identifier. |
Definition at line 226 of file upgrade.cpp.
References CPlayer::Allow, Assert, CAllow::Units, and UnitTypeMax.
Referenced by AiCountUnitBuilders().
| int UnitTypeIdByIdent | ( | const std::string & | ident | ) |
UnitType ID by identifier.
| ident | The unit-type identifier. |
Definition at line 188 of file upgrade.cpp.
References _C_, Assert, DebugPrint, CUnitType::Slot, and UnitTypeByIdent().
Referenced by AddButton(), CclDefineAllow(), and CclDefineUnitAllow().
| void UpgradesCclRegister | ( | void | ) |
Register CCL features for upgrades.
Definition at line 169 of file upgrade.cpp.
References CclDefineAllow(), CclDefineUnitAllow(), and Lua.
Referenced by InitCcl().
1.5.6