Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

Kodu::KoduConditionScored Class Reference

Kodu Condition Scored (derived from Kodu Condition). More...

#include <KoduConditionScored.h>

Inheritance diagram for Kodu::KoduConditionScored:

Detailed Description

Kodu Condition Scored (derived from Kodu Condition).

Definition at line 24 of file KoduConditionScored.h.

List of all members.

Public Types

enum  CompareType_t {
  INVALID = 0L, CT_EQUALS = 1L << 0, CT_NOT_EQUALS = 1L << 1, CT_GT_EQUAL = 1L << 2,
  CT_LT_EQUAL = 1L << 3, CT_ABOVE = 1L << 4, CT_BELOW = 1L << 5
}
 

How the target score should be compared with the current (global) score.

More...

Public Member Functions

 KoduConditionScored (bool useNot, CompareType_t compType, const NumericGenerator &kNumericGen, const std::string &kDesignator, bool numericModWasSpecified)
 Constructor.
 KoduConditionScored (const KoduConditionScored &kCondition)
 Copy constructor.
 ~KoduConditionScored ()
 Destructor.
KoduConditionScoredoperator= (const KoduConditionScored &kCondition)
 Assignment operator.
virtual bool evaluate (const KoduWorld &)
 Compares the target score against the current (global) score.
virtual void reinitialize ()
 Used to reinitialize certain variables (e.g. when switching to another page).
virtual void printAttrs () const
 Prints the attributes of a particular instance.

Static Public Member Functions

static bool isSameTypeAs (const KoduPrimitive *)
 Tests if the primitive argument is the same as the calling class.

Private Attributes

bool notModifierEnabled
 if true, NOT operator is applied to the evaluate function's result
CompareType_t type
 states how the target value and current score are compared
NumericGenerator numericGen
 returns a constant or random numeric value (the target score)
std::string designator
 the score type (the key to the Score Keeper map)
bool numericsWereSpecified
 if false, this condition returns true when a certin score changes
int lastRecordedValue
 used in conjunction with numericsWereSpecified to monitor score changes

Member Enumeration Documentation

How the target score should be compared with the current (global) score.

Enumerator:
INVALID 
CT_EQUALS 
CT_NOT_EQUALS 
CT_GT_EQUAL 
CT_LT_EQUAL 
CT_ABOVE 
CT_BELOW 

Definition at line 27 of file KoduConditionScored.h.


Constructor & Destructor Documentation

Kodu::KoduConditionScored::KoduConditionScored ( bool  useNot,
CompareType_t  compType,
const NumericGenerator kNumericGen,
const std::string &  kDesignator,
bool  numericModWasSpecified 
)

Constructor.

Definition at line 38 of file KoduConditionScored.h.

Kodu::KoduConditionScored::KoduConditionScored ( const KoduConditionScored kCondition  ) 

Copy constructor.

Definition at line 50 of file KoduConditionScored.h.

Kodu::KoduConditionScored::~KoduConditionScored (  ) 

Destructor.

Definition at line 61 of file KoduConditionScored.h.


Member Function Documentation

bool Kodu::KoduConditionScored::evaluate ( const KoduWorld kWorldState  )  [virtual]

Compares the target score against the current (global) score.

Implements Kodu::KoduCondition.

Definition at line 8 of file KoduConditionScored.cc.

bool Kodu::KoduConditionScored::isSameTypeAs ( const KoduPrimitive kPrimitive  )  [static]

Tests if the primitive argument is the same as the calling class.

Reimplemented from Kodu::KoduPrimitive.

Definition at line 55 of file KoduConditionScored.cc.

KoduConditionScored& Kodu::KoduConditionScored::operator= ( const KoduConditionScored kCondition  ) 

Assignment operator.

Definition at line 66 of file KoduConditionScored.h.

void Kodu::KoduConditionScored::printAttrs (  )  const [virtual]

Prints the attributes of a particular instance.

Reimplemented from Kodu::KoduCondition.

Definition at line 63 of file KoduConditionScored.cc.

void Kodu::KoduConditionScored::reinitialize (  )  [virtual]

Used to reinitialize certain variables (e.g. when switching to another page).

Reimplemented from Kodu::KoduCondition.

Definition at line 59 of file KoduConditionScored.cc.


Member Data Documentation

the score type (the key to the Score Keeper map)

Definition at line 95 of file KoduConditionScored.h.

Referenced by evaluate(), operator=(), and printAttrs().

used in conjunction with numericsWereSpecified to monitor score changes

Definition at line 97 of file KoduConditionScored.h.

Referenced by evaluate(), and operator=().

if true, NOT operator is applied to the evaluate function's result

Definition at line 92 of file KoduConditionScored.h.

Referenced by evaluate(), operator=(), and printAttrs().

returns a constant or random numeric value (the target score)

Definition at line 94 of file KoduConditionScored.h.

Referenced by evaluate(), operator=(), and printAttrs().

if false, this condition returns true when a certin score changes

Definition at line 96 of file KoduConditionScored.h.

Referenced by evaluate(), operator=(), and printAttrs().

states how the target value and current score are compared

Definition at line 93 of file KoduConditionScored.h.

Referenced by evaluate(), operator=(), and printAttrs().


The documentation for this class was generated from the following files:

Tekkotsu v5.1CVS
Generated Mon May 9 04:59:24 2016 by Doxygen 1.6.3