_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
Dependency rule. More...
#include <depend.h>
Public Attributes | |
DependRule * | Next |
unsigned char | Count |
next hash chain, or rules More... | |
char | Type |
how many required More... | |
union { | |
const CUnitType * UnitType | |
const CUpgrade * Upgrade | |
unit-type pointer More... | |
} | Kind |
an unit-type or upgrade More... | |
DependRule * | Rule |
required object More... | |
Dependency rule.
#include "depend.h"
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.
unsigned char DependRule::Count |
next hash chain, or rules
union { ... } DependRule::Kind |
an unit-type or upgrade
DependRule* DependRule::Next |
DependRule* DependRule::Rule |
required object
char DependRule::Type |
how many required
const CUnitType* DependRule::UnitType |
const CUpgrade* DependRule::Upgrade |
unit-type pointer