$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/ui/button_checks.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include "unittype.h"
#include "upgrade.h"
#include "depend.h"
#include "interface.h"
#include "network.h"
#include "player.h"

Functions

button_checks.cpp - The button checks.
bool ButtonCheckTrue (const CUnit &, const ButtonAction *)
 Check is always true.
bool ButtonCheckFalse (const CUnit &, const ButtonAction *)
 Check is always false.
bool ButtonCheckUpgrade (const CUnit &unit, const ButtonAction *button)
 Check if allowed upgrade is ready.
bool ButtonCheckUnitsOr (const CUnit &unit, const ButtonAction *button)
 Check if allowed units exists.
bool ButtonCheckUnitsAnd (const CUnit &unit, const ButtonAction *button)
 Check if allowed units exists.
bool ButtonCheckNetwork (const CUnit &, const ButtonAction *)
 Check if have network play.
bool ButtonCheckNoNetwork (const CUnit &, const ButtonAction *)
 Check if don't have network play.
bool ButtonCheckNoWork (const CUnit &unit, const ButtonAction *)
 Check if unit isn't working (train,upgrade,research).
bool ButtonCheckNoResearch (const CUnit &unit, const ButtonAction *)
 Check if unit isn't researching or upgrading.
bool ButtonCheckUpgradeTo (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for an upgrade to are meet.
bool ButtonCheckAttack (const CUnit &unit, const ButtonAction *)
 Check if all requirements for an attack to are meet.
bool ButtonCheckResearch (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for a research are meet.
bool ButtonCheckSingleResearch (const CUnit &unit, const ButtonAction *button)
 Check if all requirements for a single research are meet.

Function Documentation

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:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckFalse ( const CUnit ,
const ButtonAction  
)

Check is always false.

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

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckNetwork ( const CUnit ,
const ButtonAction  
)

Check if have network play.

Check if network play is enabled.

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

bool ButtonCheckNoNetwork ( const CUnit ,
const ButtonAction  
)

Check if don't have network play.

Check if network play is disabled.

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

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:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckTrue ( const CUnit ,
const ButtonAction  
)

Check is always true.

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

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckUnitsAnd ( const CUnit unit,
const ButtonAction button 
)

Check if allowed units exists.

Check for button enabled, if all units are available.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckUnitsOr ( const CUnit unit,
const ButtonAction button 
)

Check if allowed units exists.

Check for button enabled, if any unit is available.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

bool ButtonCheckUpgrade ( const CUnit unit,
const ButtonAction button 
)

Check if allowed upgrade is ready.

Check for button enabled, if upgrade is ready.

Parameters:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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:
unit Pointer to unit for button.
button Pointer to button to check/enable.
Returns:
True if enabled.

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