$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/upgrade.h File Reference

Go to the source code of this file.


Functions

upgrade.h - The upgrades headerfile.
void InitUpgrades ()
 init upgrade/allow structures
void SaveUpgrades (CFile *file)
 save the upgrades
void CleanUpgrades ()
 cleanup upgrade module
void UpgradesCclRegister ()
 Register CCL features for upgrades.
int UnitTypeIdByIdent (const std::string &sid)
int UpgradeIdByIdent (const std::string &sid)
void UpgradeAcquire (CPlayer &player, const CUpgrade *upgrade)
 Upgrade will be acquired.
void UpgradeLost (CPlayer &player, int id)
int UnitIdAllowed (const CPlayer &player, int id)
char UpgradeIdAllowed (const CPlayer &player, int id)
char UpgradeIdentAllowed (const CPlayer &player, const std::string &ident)
int UpgradeIdentAvailable (const CPlayer &player, const std::string &ident)
 Check if the upgrade is researched.

Function Documentation

void CleanUpgrades (  ) 

cleanup upgrade module

Cleanup the upgrade module.

void InitUpgrades (  ) 

init upgrade/allow structures

Init upgrade/allow structures

void SaveUpgrades ( CFile file  ) 

save the upgrades

Save state of the dependencies to file.

Parameters:
file Output file.

int UnitIdAllowed ( const CPlayer player,
int  id 
)

Return the allow state of the unit.

Parameters:
player Check state of this player.
id Unit identifier.
Returns:
the allow state of the unit.

int UnitTypeIdByIdent ( const std::string &  ident  ) 

UnitType ID by identifier.

Parameters:
ident The unit-type identifier.
Returns:
Unit-type ID (int) or -1 if not found.

void UpgradeAcquire ( CPlayer player,
const CUpgrade upgrade 
)

Upgrade will be acquired.

Handle that an upgrade was acquired.

Parameters:
player Player researching the upgrade.
upgrade Upgrade ready researched.

char UpgradeIdAllowed ( const CPlayer player,
int  id 
)

Return the allow state of an upgrade.

Parameters:
player Check state for this player.
id Upgrade identifier.
Returns:
the allow state of the upgrade.

int UpgradeIdByIdent ( const std::string &  ident  ) 

Upgrade ID by identifier.

Parameters:
ident The upgrade identifier.
Returns:
Upgrade ID (int) or -1 if not found.

char UpgradeIdentAllowed ( const CPlayer player,
const std::string &  ident 
)

Return the allow state of an upgrade.

Parameters:
player Check state for this player.
ident Upgrade identifier.
Note:
This function shouldn't be used during runtime, it is only for setup.

int UpgradeIdentAvailable ( const CPlayer player,
const std::string &  ident 
)

Check if the upgrade is researched.

Check if upgrade (also spells) available for the player.

Parameters:
player Player pointer.
ident Upgrade ident.

void UpgradeLost ( CPlayer player,
int  id 
)

for now it will be empty? perhaps acquired upgrade can be lost if (for example) a building is lost (lumber mill? stronghold?) this function will apply all modifiers in reverse way

void UpgradesCclRegister (  ) 

Register CCL features for upgrades.

Register CCL features for upgrades.

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