Planeshift
psQuestPrereqOpRequire Class Reference

Require prerequisite operator. More...

#include <psquestprereqops.h>

Public Member Functions

virtual bool Check (psCharacter *character)
 Check if a number of prerequisites are true. More...
 
virtual csPtr< psQuestPrereqOpCopy ()
 Copy the prerequisite operator. More...
 
virtual csString GetScriptOp ()
 Convert the prerequisite operator to a xml string. More...
 
 psQuestPrereqOpRequire (int min_required, int max_required)
 Construct a require operator. More...
 
virtual ~psQuestPrereqOpRequire ()
 Destructor for the require prerequisite operator. More...
 
- Public Member Functions inherited from psQuestPrereqOpList
virtual void Insert (size_t n, csRef< psQuestPrereqOp > prereqOp)
 Insert a new child prerequisite onto the child list. More...
 
virtual void Push (csRef< psQuestPrereqOp > prereqOp)
 Push a new child prerequisite onto the child list. More...
 
virtual ~psQuestPrereqOpList ()
 Destructor for the list prerequisite operator. More...
 
- Public Member Functions inherited from psQuestPrereqOp
virtual csString GetScript ()
 Convert the prerequisite script to a xml string. More...
 
virtual ~psQuestPrereqOp ()
 Destructor for the prerequisite operator. More...
 

Additional Inherited Members

- Protected Attributes inherited from psQuestPrereqOpList
csRefArray< psQuestPrereqOpprereqlist
 The list of child prerequisite operators for this list operator. More...
 

Detailed Description

Require prerequisite operator.

A multi term require operator. The given minimum and/or maximum of childs have to be completed for this prerequisite to be true.

Definition at line 254 of file psquestprereqops.h.

Constructor & Destructor Documentation

psQuestPrereqOpRequire::psQuestPrereqOpRequire ( int  min_required,
int  max_required 
)

Construct a require operator.

Parameters
min_requiredThe minimum of childs needed. There is no lower limit if this is set to -1.
max_requiredThe maximum of childs needed. There is no upper limit if this is set to -1.
virtual psQuestPrereqOpRequire::~psQuestPrereqOpRequire ( )
inlinevirtual

Destructor for the require prerequisite operator.

Definition at line 272 of file psquestprereqops.h.

Member Function Documentation

virtual bool psQuestPrereqOpRequire::Check ( psCharacter character)
virtual

Check if a number of prerequisites are true.

Limited by a min and a max number. If any of these are -1 the limit will be ignored.

number = number of childs true prerequisite = number >= min and number <= max

Parameters
characterThe character being checked for a prerequisite
Returns
True if more than min and less than max of the child prerequisites are true

Implements psQuestPrereqOp.

virtual csPtr<psQuestPrereqOp> psQuestPrereqOpRequire::Copy ( )
virtual

Copy the prerequisite operator.

Override this function to return a copy of the prerequisite operator.

Returns
Copy of the prerequisite operator.

Implements psQuestPrereqOp.

virtual csString psQuestPrereqOpRequire::GetScriptOp ( )
virtual

Convert the prerequisite operator to a xml string.

Convert the operator into the xml string: <require [min="min"] [max="max"]><child1>...<childN></require>

Returns
XML string for the prerequisite operator.

Implements psQuestPrereqOp.


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