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

Public Attributes | List of all members
DependRule Struct Reference

Dependency rule. More...

#include <depend.h>

Public Attributes

DependRuleNext
 
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...
 
DependRuleRule
 required object More...
 

Detailed Description

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:

DependRule::Next

Next rule in hash chain for the base upgrade/unit-type. Next and-rule for the requirements.

DependRule::Count

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.

DependRule::Type

Type of the rule, DependRuleUnitType for an unit-type, DependRuleUpgrade for an upgrade.

DependRule::Kind

Contains the element of rule. Depending on DependRule::Type.

DependRule::Kind::UnitType

An unit-type pointer.

DependRule::Kind::Upgrade

An upgrade pointer.

DependRule::Rule

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

Member Data Documentation

◆ Count

unsigned char DependRule::Count

next hash chain, or rules

◆ Kind

union { ... } DependRule::Kind

an unit-type or upgrade

◆ Next

DependRule* DependRule::Next

◆ Rule

DependRule* DependRule::Rule

required object

◆ Type

char DependRule::Type

how many required

◆ UnitType

const CUnitType* DependRule::UnitType

◆ Upgrade

const CUpgrade* DependRule::Upgrade

unit-type pointer


The documentation for this struct was generated from the following file:
(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.