Logo Search packages:      
Sourcecode: freecraft version File versions  Download package

_depend_rule_ Struct Reference

#include <depend.h>

List of all members.

Detailed Description

Dependency rule.

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


An unit-type pointer.


An upgrade pointer.


For the base upgrade/unit-type the rules which must be meet. For the requirements alternative or-rules.

Definition at line 110 of file depend.h.

Public Attributes

unsigned char Count
 next hash chain, or rules
union {
   UnitType *   UnitType
   Upgrade *   Upgrade
 unit-type pointer
 an unit-type or upgrade
 required object
char Type
 how many required

The documentation for this struct was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index