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

A quest node is a task or stage in a quest. More...

Public Member Functions

string GetEditorName ()
 
 QuestNode ()
 
 QuestNode (StringField id, StringField internalName, QuestNodeType nodeType, bool isOptional=false)
 
void InitializeAsStartNode (string questID)
 
void CloneSubassetsInto (QuestNode copy, Quest quest=null)
 
void DestroySubassets ()
 
void InitializeRuntimeReferences (Quest quest)
 
void ConnectRuntimeNodeReferences ()
 
void SetRuntimeNodeReferences ()
 
QuestNodeState GetState ()
 Returns the current state of the quest node.
 
void SetState (QuestNodeState newState, bool informListeners=true)
 Sets the quest node to a quest state and performs all related activities such as enabling connections and executing actions.
 
void SetStateRaw (QuestNodeState state)
 Sets the internal state value without performing any state change processing.
 
QuestStateInfo GetStateInfo (QuestNodeState state)
 Returns the state info associated with a quest node state.
 
void SetConditionChecking (bool enable)
 Starts or stops condition checking on condition nodes.
 
void ResetConditions ()
 
bool HasContent (QuestContentCategory category)
 Checks if there is any UI content for a specific category.
 
List< QuestContentGetContentList (QuestContentCategory category)
 Gets the UI content for a specific category.
 

Static Public Member Functions

static void CloneSubassets (List< QuestNode > original, List< QuestNode > copy, Quest quest=null)
 
static void DestroyListSubassets (List< QuestNode > nodes)
 

Public Attributes

List< QuestNodem_childList
 

Static Public Attributes

const float DefaultNodeWidth = 120
 
const float DefaultNodeHeight = 48
 
const float ShortNodeHeight = 35
 
const float DefaultStartNodeX = 200
 
const float DefaultStartNodeY = 20
 

Properties

StringField id [get, set]
 Internal ID of the quest node, used to reference quest nodes in scripts.
 
StringField internalName [get, set]
 Name for your internal reference; shown only in the editor.
 
QuestNodeType nodeType [get, set]
 Type of node, which determines some of its behavior.
 
bool isEndNodeType [get]
 Specifies that the node is a type that terminates the quest tree.
 
bool isConnectionNodeType [get]
 Specifies that the node is a type that can connect to other nodes.
 
bool isOptional [get, set]
 Completion of this quest node is optional.
 
StringField speaker [get, set]
 Speaker of this node's dialogue content.
 
List< QuestStateInfostateInfoList [get, set]
 Info (actions & UI content) for a specific quest state.
 
QuestConditionSet conditionSet [get, set]
 Conditions required for the node's state to become true.
 
List< int > childIndexList [get, set]
 Indices into the quest's node list.
 
Quest quest [get, set]
 The Quest that this node belongs to.
 
List< QuestNodechildList [get, set]
 References to the child nodes linked from this node.
 
List< QuestNodeparentList [get, set]
 References to the parent nodes that link to this node.
 
List< QuestNodeoptionalParentList [get, set]
 The subset of parents that are marked optional.
 
List< QuestNodenonoptionalParentList [get, set]
 The subset of parents that are not marked optional.
 
TagDictionary tagDictionary [get, set]
 Dictionary of tags defined in this quest node and their values.
 
Rect canvasRect [get, set]
 Position of the quest node in the Quest Editor window.
 

Events

QuestNodeParameterDelegate stateChanged = delegate { }
 Invoked when the node changes state.
 

Detailed Description

A quest node is a task or stage in a quest.

Constructor & Destructor Documentation

◆ QuestNode() [1/2]

PixelCrushers.QuestMachine.QuestNode.QuestNode ( )
inline

◆ QuestNode() [2/2]

PixelCrushers.QuestMachine.QuestNode.QuestNode ( StringField  id,
StringField  internalName,
QuestNodeType  nodeType,
bool  isOptional = false 
)
inline

Member Function Documentation

◆ CloneSubassets()

static void PixelCrushers.QuestMachine.QuestNode.CloneSubassets ( List< QuestNode original,
List< QuestNode copy,
Quest  quest = null 
)
inlinestatic

◆ CloneSubassetsInto()

void PixelCrushers.QuestMachine.QuestNode.CloneSubassetsInto ( QuestNode  copy,
Quest  quest = null 
)
inline

◆ ConnectRuntimeNodeReferences()

void PixelCrushers.QuestMachine.QuestNode.ConnectRuntimeNodeReferences ( )
inline

◆ DestroyListSubassets()

static void PixelCrushers.QuestMachine.QuestNode.DestroyListSubassets ( List< QuestNode nodes)
inlinestatic

◆ DestroySubassets()

void PixelCrushers.QuestMachine.QuestNode.DestroySubassets ( )
inline

◆ GetContentList()

List< QuestContent > PixelCrushers.QuestMachine.QuestNode.GetContentList ( QuestContentCategory  category)
inline

Gets the UI content for a specific category.

Parameters
categoryThe content category (Dialogue, Journal, etc.).
Returns
A list of UI content items based on the current state of the quest and all of its nodes.

◆ GetEditorName()

string PixelCrushers.QuestMachine.QuestNode.GetEditorName ( )
inline

◆ GetState()

QuestNodeState PixelCrushers.QuestMachine.QuestNode.GetState ( )
inline

Returns the current state of the quest node.

◆ GetStateInfo()

QuestStateInfo PixelCrushers.QuestMachine.QuestNode.GetStateInfo ( QuestNodeState  state)
inline

Returns the state info associated with a quest node state.

◆ HasContent()

bool PixelCrushers.QuestMachine.QuestNode.HasContent ( QuestContentCategory  category)
inline

Checks if there is any UI content for a specific category.

Parameters
categoryThe content category (Dialogue, Journal, etc.).
Returns
True if GetContentList would return anything.

◆ InitializeAsStartNode()

void PixelCrushers.QuestMachine.QuestNode.InitializeAsStartNode ( string  questID)
inline

◆ InitializeRuntimeReferences()

void PixelCrushers.QuestMachine.QuestNode.InitializeRuntimeReferences ( Quest  quest)
inline

◆ ResetConditions()

void PixelCrushers.QuestMachine.QuestNode.ResetConditions ( )
inline

◆ SetConditionChecking()

void PixelCrushers.QuestMachine.QuestNode.SetConditionChecking ( bool  enable)
inline

Starts or stops condition checking on condition nodes.

Parameters
enableSpecifies whether to start (enable) or stop.

◆ SetRuntimeNodeReferences()

void PixelCrushers.QuestMachine.QuestNode.SetRuntimeNodeReferences ( )
inline

◆ SetState()

void PixelCrushers.QuestMachine.QuestNode.SetState ( QuestNodeState  newState,
bool  informListeners = true 
)
inline

Sets the quest node to a quest state and performs all related activities such as enabling connections and executing actions.

This may cause other nodes to advance their states, too.

Parameters
newStateNew state.

◆ SetStateRaw()

void PixelCrushers.QuestMachine.QuestNode.SetStateRaw ( QuestNodeState  state)
inline

Sets the internal state value without performing any state change processing.

Member Data Documentation

◆ DefaultNodeHeight

const float PixelCrushers.QuestMachine.QuestNode.DefaultNodeHeight = 48
static

◆ DefaultNodeWidth

const float PixelCrushers.QuestMachine.QuestNode.DefaultNodeWidth = 120
static

◆ DefaultStartNodeX

const float PixelCrushers.QuestMachine.QuestNode.DefaultStartNodeX = 200
static

◆ DefaultStartNodeY

const float PixelCrushers.QuestMachine.QuestNode.DefaultStartNodeY = 20
static

◆ m_childList

List<QuestNode> PixelCrushers.QuestMachine.QuestNode.m_childList

◆ ShortNodeHeight

const float PixelCrushers.QuestMachine.QuestNode.ShortNodeHeight = 35
static

Property Documentation

◆ canvasRect

Rect PixelCrushers.QuestMachine.QuestNode.canvasRect
getset

Position of the quest node in the Quest Editor window.

◆ childIndexList

List<int> PixelCrushers.QuestMachine.QuestNode.childIndexList
getset

Indices into the quest's node list.

Since Unity can't serialize nested types, such as a QuestNode reference inside the QuestNode class, we use a list of indices to record connections between nodes for serialization. At runtime, we use this list of indices to construct a list of QuestNode references.

◆ childList

List<QuestNode> PixelCrushers.QuestMachine.QuestNode.childList
getset

References to the child nodes linked from this node.

◆ conditionSet

QuestConditionSet PixelCrushers.QuestMachine.QuestNode.conditionSet
getset

Conditions required for the node's state to become true.

◆ id

StringField PixelCrushers.QuestMachine.QuestNode.id
getset

Internal ID of the quest node, used to reference quest nodes in scripts.

◆ internalName

StringField PixelCrushers.QuestMachine.QuestNode.internalName
getset

Name for your internal reference; shown only in the editor.

◆ isConnectionNodeType

bool PixelCrushers.QuestMachine.QuestNode.isConnectionNodeType
get

Specifies that the node is a type that can connect to other nodes.

◆ isEndNodeType

bool PixelCrushers.QuestMachine.QuestNode.isEndNodeType
get

Specifies that the node is a type that terminates the quest tree.

◆ isOptional

bool PixelCrushers.QuestMachine.QuestNode.isOptional
getset

Completion of this quest node is optional.

◆ nodeType

QuestNodeType PixelCrushers.QuestMachine.QuestNode.nodeType
getset

Type of node, which determines some of its behavior.

◆ nonoptionalParentList

List<QuestNode> PixelCrushers.QuestMachine.QuestNode.nonoptionalParentList
getset

The subset of parents that are not marked optional.

◆ optionalParentList

List<QuestNode> PixelCrushers.QuestMachine.QuestNode.optionalParentList
getset

The subset of parents that are marked optional.

◆ parentList

List<QuestNode> PixelCrushers.QuestMachine.QuestNode.parentList
getset

References to the parent nodes that link to this node.

◆ quest

Quest PixelCrushers.QuestMachine.QuestNode.quest
getset

The Quest that this node belongs to.

◆ speaker

StringField PixelCrushers.QuestMachine.QuestNode.speaker
getset

Speaker of this node's dialogue content.

If unassigned, the quest giver is the speaker.

◆ stateInfoList

List<QuestStateInfo> PixelCrushers.QuestMachine.QuestNode.stateInfoList
getset

Info (actions & UI content) for a specific quest state.

This list is indexed by the int value of the QuestState enum, such as stateInfoList[(int)QuestState.Active].

◆ tagDictionary

TagDictionary PixelCrushers.QuestMachine.QuestNode.tagDictionary
getset

Dictionary of tags defined in this quest node and their values.

Event Documentation

◆ stateChanged

QuestNodeParameterDelegate PixelCrushers.QuestMachine.QuestNode.stateChanged = delegate { }

Invoked when the node changes state.


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