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

button_checks.cpp File Reference
#include "stratagus.h"
#include "actions.h"
#include "depend.h"
#include "interface.h"
#include "network.h"
#include "player.h"
#include "unit.h"
#include "unittype.h"
#include "upgrade.h"
#include <stdio.h>

Functions

button_checks.cpp - The button checks.
bool ButtonCheckTrue (const CUnit &, const ButtonAction &)
 Check is always true. More...
 
bool ButtonCheckFalse (const CUnit &, const ButtonAction &)
 Check is always false. More...
 
bool ButtonCheckUpgrade (const CUnit &unit, const ButtonAction &button)
 Check if allowed upgrade is ready. More...
 
bool ButtonCheckIndividualUpgrade (const CUnit &unit, const ButtonAction &button)
 Check if unit has an individual upgrade. More...
 
bool ButtonCheckUnitVariable (const CUnit &unit, const ButtonAction &button)
 Check if unit's variables pass the condition check. More...
 
bool ButtonCheckUnitsOr (const CUnit &unit, const ButtonAction &button)
 Check if allowed units exists. More...
 
bool ButtonCheckUnitsAnd (const CUnit &unit, const ButtonAction &button)
 Check if allowed units exists. More...
 
bool ButtonCheckUnitsNot (const CUnit &unit, const ButtonAction &button)
 Check if not one unit exist. More...
 
bool ButtonCheckUnitsNor (const CUnit &unit, const ButtonAction &button)
 Check if none of the units exist. More...
 
bool ButtonCheckNetwork (const CUnit &, const ButtonAction &)
 Check if have network play. More...
 
bool ButtonCheckNoNetwork (const CUnit &, const ButtonAction &)
 Check if don't have network play. More...
 
bool ButtonCheckNoWork (const CUnit &unit, const ButtonAction &)
 Check if unit isn't working (train,upgrade,research) More...
 
bool ButtonCheckNoResearch (const CUnit &unit, const ButtonAction &)
 Check if unit isn't researching or upgrading. More...
 
bool ButtonCheckUpgradeTo (const CUnit &unit, const ButtonAction &button)
 Check if all requirements for an upgrade to are meet. More...
 
bool ButtonCheckAttack (const CUnit &unit, const ButtonAction &)
 Check if all requirements for an attack to are meet. More...
 
bool ButtonCheckResearch (const CUnit &unit, const ButtonAction &button)
 Check if all requirements for a research are meet. More...
 
bool ButtonCheckSingleResearch (const CUnit &unit, const ButtonAction &button)
 Check if all requirements for a single research are meet. More...
 
bool ButtonCheckDebug (const CUnit &, const ButtonAction &button)
 Check for button enabled, if requested condition passes check. Used for debug purposes. More...
 

Function Documentation

◆ ButtonCheckAttack()

bool ButtonCheckAttack ( const CUnit unit,
const ButtonAction  
)

Check if all requirements for an attack to are meet.

Check if all requirements for an attack are met.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckDebug()

bool ButtonCheckDebug ( const CUnit ,
const ButtonAction button 
)

Check for button enabled, if requested condition passes check. Used for debug purposes.

Check for button enabled, if requested condition passes check Used for debug purposes

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if check passed.

Check if enabled walls for singleplayer games

◆ ButtonCheckFalse()

bool ButtonCheckFalse ( const CUnit ,
const ButtonAction  
)

Check is always false.

Check for button enabled, always false. This needed to overwrite the internal tests.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckIndividualUpgrade()

bool ButtonCheckIndividualUpgrade ( const CUnit unit,
const ButtonAction button 
)

Check if unit has an individual upgrade.

Check for button enabled, if unit has an individual upgrade.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckNetwork()

bool ButtonCheckNetwork ( const CUnit ,
const ButtonAction  
)

Check if have network play.

Check if network play is enabled.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.
Note
: this check could also be moved into intialisation.

◆ ButtonCheckNoNetwork()

bool ButtonCheckNoNetwork ( const CUnit ,
const ButtonAction  
)

Check if don't have network play.

Check if network play is disabled.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if disabled.
Note
: this check could also be moved into intialisation.

◆ ButtonCheckNoResearch()

bool ButtonCheckNoResearch ( const CUnit unit,
const ButtonAction  
)

Check if unit isn't researching or upgrading.

Check for button enabled, if the unit isn't researching.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckNoWork()

bool ButtonCheckNoWork ( const CUnit unit,
const ButtonAction  
)

Check if unit isn't working (train,upgrade,research)

Check for button enabled, if the unit isn't working. Working is training, upgrading, researching.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckResearch()

bool ButtonCheckResearch ( const CUnit unit,
const ButtonAction button 
)

Check if all requirements for a research are meet.

Check if all requirements for upgrade research are met.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckSingleResearch()

bool ButtonCheckSingleResearch ( const CUnit unit,
const ButtonAction button 
)

Check if all requirements for a single research are meet.

Check if all requirements for upgrade research are met only one running research allowed.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckTrue()

bool ButtonCheckTrue ( const CUnit ,
const ButtonAction  
)

Check is always true.

ButtonCheck for button enabled, always true. This needed to overwrite the internal tests.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUnitsAnd()

bool ButtonCheckUnitsAnd ( const CUnit unit,
const ButtonAction button 
)

Check if allowed units exists.

Check for button enabled, if all units are available.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUnitsNor()

bool ButtonCheckUnitsNor ( const CUnit unit,
const ButtonAction button 
)

Check if none of the units exist.

Check for button enabled, if none of the units are available.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUnitsNot()

bool ButtonCheckUnitsNot ( const CUnit unit,
const ButtonAction button 
)

Check if not one unit exist.

Check for button enabled, if not all units are available.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUnitsOr()

bool ButtonCheckUnitsOr ( const CUnit unit,
const ButtonAction button 
)

Check if allowed units exists.

Check for button enabled, if any unit is available.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUnitVariable()

bool ButtonCheckUnitVariable ( const CUnit unit,
const ButtonAction button 
)

Check if unit's variables pass the condition check.

Check for button enabled, if unit's variables pass the condition check.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUpgrade()

bool ButtonCheckUpgrade ( const CUnit unit,
const ButtonAction button 
)

Check if allowed upgrade is ready.

Check for button enabled, if upgrade is ready.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.

◆ ButtonCheckUpgradeTo()

bool ButtonCheckUpgradeTo ( const CUnit unit,
const ButtonAction button 
)

Check if all requirements for an upgrade to are meet.

Check for button enabled, if all requirements for an upgrade to unit are met.

Parameters
unitPointer to unit for button.
buttonPointer to button to check/enable.
Returns
True if enabled.
(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.