Loading...
Searching...
No Matches
PixelCrushers.QuestMachine.QuestCounter Class Reference

Holds an integer that a quest can use to track a value. More...

Inheritance diagram for PixelCrushers.QuestMachine.QuestCounter:
Collaboration diagram for PixelCrushers.QuestMachine.QuestCounter:

Public Member Functions

 QuestCounter ()
 
 QuestCounter (StringField name, int currentValue, int minValue, int maxValue, QuestCounterUpdateMode updateMode)
 
void SetRuntimeReferences (Quest quest)
 
void InitializeToRandomValue ()
 
void SetValue (int newValue, QuestCounterSetValueMode setValueMode=QuestCounterSetValueMode.InformListeners)
 
void SetListeners (bool enable)
 
void OnMessage (MessageArgs messageArgs)
 Handles a message that the message handler is listening for.
 

Properties

StringField name [get, set]
 Quest counter name.
 
int currentValue [get, set]
 Current value.
 
bool randomizeInitialValue [get, set]
 Initialize the current value to a random value between min and max value.
 
int minValue [get, set]
 Min value.
 
int maxValue [get, set]
 Max value.
 
QuestCounterUpdateMode updateMode [get, set]
 How this counter updates its value.
 
List< QuestCounterMessageEventmessageEventList [get, set]
 When updateMode is Messages, these message events affect the counter value.
 

Events

QuestCounterParameterDelegate changed = delegate { }
 

Detailed Description

Holds an integer that a quest can use to track a value.

Counters can be updated by messages (e.g., "Kill"+"Orc") or a DataSynchronizer. When the value changes, the counter invokes a changed event.

Constructor & Destructor Documentation

◆ QuestCounter() [1/2]

PixelCrushers.QuestMachine.QuestCounter.QuestCounter ( )
inline

◆ QuestCounter() [2/2]

PixelCrushers.QuestMachine.QuestCounter.QuestCounter ( StringField  name,
int  currentValue,
int  minValue,
int  maxValue,
QuestCounterUpdateMode  updateMode 
)
inline

Member Function Documentation

◆ InitializeToRandomValue()

void PixelCrushers.QuestMachine.QuestCounter.InitializeToRandomValue ( )
inline

◆ OnMessage()

void PixelCrushers.QuestMachine.QuestCounter.OnMessage ( MessageArgs  messageArgs)
inline

Handles a message that the message handler is listening for.

Parameters
messageArgsThe message that was sent to the MessageSystem.

Implements PixelCrushers.IMessageHandler.

◆ SetListeners()

void PixelCrushers.QuestMachine.QuestCounter.SetListeners ( bool  enable)
inline

◆ SetRuntimeReferences()

void PixelCrushers.QuestMachine.QuestCounter.SetRuntimeReferences ( Quest  quest)
inline

◆ SetValue()

void PixelCrushers.QuestMachine.QuestCounter.SetValue ( int  newValue,
QuestCounterSetValueMode  setValueMode = QuestCounterSetValueMode::InformListeners 
)
inline

Property Documentation

◆ currentValue

int PixelCrushers.QuestMachine.QuestCounter.currentValue
getset

Current value.

When you set this property, it notifies listeners.

◆ maxValue

int PixelCrushers.QuestMachine.QuestCounter.maxValue
getset

Max value.

◆ messageEventList

List<QuestCounterMessageEvent> PixelCrushers.QuestMachine.QuestCounter.messageEventList
getset

When updateMode is Messages, these message events affect the counter value.

◆ minValue

int PixelCrushers.QuestMachine.QuestCounter.minValue
getset

Min value.

◆ name

StringField PixelCrushers.QuestMachine.QuestCounter.name
getset

Quest counter name.

◆ randomizeInitialValue

bool PixelCrushers.QuestMachine.QuestCounter.randomizeInitialValue
getset

Initialize the current value to a random value between min and max value.

◆ updateMode

QuestCounterUpdateMode PixelCrushers.QuestMachine.QuestCounter.updateMode
getset

How this counter updates its value.

Event Documentation

◆ changed

QuestCounterParameterDelegate PixelCrushers.QuestMachine.QuestCounter.changed = delegate { }

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