$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <depend.h>
typedef struct _depend_rule_ DependRule;
This structure is used define the requirements of upgrades or unit-types. The structure is used to define the base (the wanted) upgrade or unit-type and the requirements upgrades or unit-types. The requirements could be combination of and-rules and or-rules.
This structure is very complex because nearly everything has two meanings.
The depend-rule structure members:
Next rule in hash chain for the base upgrade/unit-type. Next and-rule for the requirements.
If DependRule::Type is DependRuleUnitType, the counter is how many units of the unit-type are required, if zero no unit of this unit-type is allowed. if DependRule::Type is DependRuleUpgrade, for a non-zero counter the upgrade must be researched, for a zero counter the upgrade must be unresearched.
Type of the rule, DependRuleUnitType for an unit-type, DependRuleUpgrade for an upgrade.
Contains the element of rule. Depending on DependRule::Type.
DependRule::Kind::UnitType
An unit-type pointer.
DependRule::Kind::Upgrade
An upgrade pointer.
For the base upgrade/unit-type the rules which must be meet. For the requirements alternative or-rules.