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

upgrade.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 1999-2006 by Vladi Belperchinov-Shabanski and Jimmy Salmon
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __UPGRADE_H__
31 #define __UPGRADE_H__
32 
34 
35 /*----------------------------------------------------------------------------
36 -- Declarations
37 ----------------------------------------------------------------------------*/
38 
39 class CFile;
40 class CPlayer;
41 class CUpgrade;
42 
43 /*----------------------------------------------------------------------------
44 -- Variables
45 ----------------------------------------------------------------------------*/
46 
47 /*----------------------------------------------------------------------------
48 -- Functions
49 ----------------------------------------------------------------------------*/
50 
52 extern void InitUpgrades();
54 extern void SaveUpgrades(CFile &file);
56 extern void CleanUpgrades();
57 
59 extern void UpgradesCclRegister();
60 
61 /*----------------------------------------------------------------------------
62 -- General/Map functions
63 ----------------------------------------------------------------------------*/
64 
65 // AllowStruct and UpgradeTimers will be static in the player so will be
66 // load/saved with the player struct
67 
68 extern int UnitTypeIdByIdent(const std::string &sid);
69 extern int UpgradeIdByIdent(const std::string &sid);
70 
71 /*----------------------------------------------------------------------------
72 -- Upgrades
73 ----------------------------------------------------------------------------*/
74 
76 extern void UpgradeAcquire(CPlayer &player, const CUpgrade *upgrade);
78 extern void UpgradeLost(CPlayer &player, int id);
80 extern void ApplyUpgrades();
81 
82 /*----------------------------------------------------------------------------
83 -- Allow(s)
84 ----------------------------------------------------------------------------*/
85 
86 // all the following functions are just map handlers, no specific notes
87 // id -- unit type id, af -- `A'llow/`F'orbid
88 
89 extern int UnitIdAllowed(const CPlayer &player, int id);
90 extern void AllowUpgradeId(CPlayer &player, int id, char af);
91 
92 extern char UpgradeIdAllowed(const CPlayer &player, int id);
93 extern char UpgradeIdentAllowed(const CPlayer &player, const std::string &ident);
94 
96 
97 #endif // !__UPGRADE_H__
void SaveUpgrades(CFile &file)
save the upgrades
Definition: upgrade.cpp:204
void CleanUpgrades()
cleanup upgrade module
Definition: upgrade.cpp:180
int UnitTypeIdByIdent(const std::string &sid)
Definition: upgrade.cpp:436
char UpgradeIdAllowed(const CPlayer &player, int id)
Definition: upgrade.cpp:886
Definition: iolib.h:101
void UpgradeAcquire(CPlayer &player, const CUpgrade *upgrade)
Upgrade will be acquired.
Definition: upgrade.cpp:761
void InitUpgrades()
init upgrade/allow structures
Definition: upgrade.cpp:173
void ApplyUpgrades()
Apply researched upgrades when map is loading.
Definition: upgrade.cpp:811
int UpgradeIdByIdent(const std::string &sid)
Definition: upgrade.cpp:454
void UpgradesCclRegister()
Register CCL features for upgrades.
Definition: upgrade.cpp:416
Diplomacy states for CommandDiplomacy.
Definition: player.h:79
void UpgradeLost(CPlayer &player, int id)
Upgrade will be lost.
Definition: upgrade.cpp:788
char UpgradeIdentAllowed(const CPlayer &player, const std::string &ident)
Definition: upgrade.cpp:902
void AllowUpgradeId(CPlayer &player, int id, char af)
Definition: upgrade.cpp:858
Definition: upgrade_structs.h:152
int UnitIdAllowed(const CPlayer &player, int id)
Definition: upgrade.cpp:872
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.