v3.6.1 Documentation
Fungus.Block Class Reference

A container for a sequence of Fungus comands. More...

Inheritance diagram for Fungus.Block:
Fungus.Node Fungus.CommandCopyBuffer

Public Member Functions

virtual Flowchart GetFlowchart ()
 Returns the parent Flowchart for this Block. More...
 
virtual bool IsExecuting ()
 Returns true if the Block is executing a command. More...
 
virtual int GetExecutionCount ()
 Returns the number of times this Block has executed. More...
 
virtual void StartExecution ()
 Start a coroutine which executes all commands in the Block. More...
 
virtual IEnumerator Execute (int commandIndex=0, Action onComplete=null)
 A coroutine method that executes all commands in the Block. More...
 
virtual void Stop ()
 Stop executing commands in this Block. More...
 
virtual List< BlockGetConnectedBlocks ()
 Returns a list of all Blocks connected to this one. More...
 
virtual System.Type GetPreviousActiveCommandType ()
 Returns the type of the previously executing command. More...
 
virtual void UpdateIndentLevels ()
 Recalculate the indent levels for all commands in the list. More...
 
virtual int GetLabelIndex (string labelKey)
 Returns the index of the Label command with matching key, or -1 if not found. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void SetExecutionInfo ()
 Populate the command metadata used to control execution. More...
 

Protected Attributes

int itemId = -1
 
string blockName = "New Block"
 
string description = ""
 
EventHandler eventHandler
 
List< CommandcommandList = new List<Command>()
 
ExecutionState executionState
 
Command activeCommand
 
int previousActiveCommandIndex = -1
 
int jumpToCommandIndex = -1
 
int executionCount
 
bool executionInfoSet = false
 
- Protected Attributes inherited from Fungus.Node
Rect nodeRect = new Rect(0, 0, 120, 30)
 
Color tint = Color.white
 
bool useCustomTint = false
 

Properties

virtual ExecutionState State [get]
 The execution state of the Block. More...
 
virtual int ItemId [get, set]
 Unique identifier for the Block. More...
 
virtual string BlockName [get, set]
 The name of the block node as displayed in the Flowchart window. More...
 
virtual string Description [get]
 Description text to display under the block node More...
 
virtual EventHandler _EventHandler [get, set]
 An optional Event Handler which can execute the block when an event occurs. More...
 
virtual Command ActiveCommand [get]
 The currently executing command. More...
 
virtual float ExecutingIconTimer [get, set]
 Timer for fading Block execution icon. More...
 
virtual List< CommandCommandList [get]
 The list of commands in the sequence. More...
 
virtual int JumpToCommandIndex [set]
 Controls the next command to execute in the block execution coroutine. More...
 
- Properties inherited from Fungus.Node
virtual Rect _NodeRect [get, set]
 
virtual Color Tint [get, set]
 
virtual bool UseCustomTint [get, set]
 

Detailed Description

A container for a sequence of Fungus comands.

Definition at line 29 of file Block.cs.

Member Function Documentation

◆ Awake()

virtual void Fungus.Block.Awake ( )
protectedvirtual

Definition at line 62 of file Block.cs.

◆ Execute()

virtual IEnumerator Fungus.Block.Execute ( int  commandIndex = 0,
Action  onComplete = null 
)
virtual

A coroutine method that executes all commands in the Block.

Only one running instance of each Block is permitted.

Parameters
commandIndexIndex of command to start execution at
onCompleteDelegate function to call when execution completes

Definition at line 199 of file Block.cs.

◆ GetConnectedBlocks()

virtual List<Block> Fungus.Block.GetConnectedBlocks ( )
virtual

Returns a list of all Blocks connected to this one.

Definition at line 329 of file Block.cs.

◆ GetExecutionCount()

virtual int Fungus.Block.GetExecutionCount ( )
virtual

Returns the number of times this Block has executed.

Definition at line 181 of file Block.cs.

◆ GetFlowchart()

virtual Flowchart Fungus.Block.GetFlowchart ( )
virtual

Returns the parent Flowchart for this Block.

Definition at line 165 of file Block.cs.

◆ GetLabelIndex()

virtual int Fungus.Block.GetLabelIndex ( string  labelKey)
virtual

Returns the index of the Label command with matching key, or -1 if not found.

Definition at line 388 of file Block.cs.

◆ GetPreviousActiveCommandType()

virtual System.Type Fungus.Block.GetPreviousActiveCommandType ( )
virtual

Returns the type of the previously executing command.

Returns
The previous active command type.

Definition at line 347 of file Block.cs.

◆ IsExecuting()

virtual bool Fungus.Block.IsExecuting ( )
virtual

Returns true if the Block is executing a command.

Definition at line 173 of file Block.cs.

◆ SetExecutionInfo()

virtual void Fungus.Block.SetExecutionInfo ( )
protectedvirtual

Populate the command metadata used to control execution.

Definition at line 70 of file Block.cs.

◆ StartExecution()

virtual void Fungus.Block.StartExecution ( )
virtual

Start a coroutine which executes all commands in the Block.

Only one running instance of each Block is permitted.

Definition at line 189 of file Block.cs.

◆ Stop()

virtual void Fungus.Block.Stop ( )
virtual

Stop executing commands in this Block.

Definition at line 313 of file Block.cs.

◆ UpdateIndentLevels()

virtual void Fungus.Block.UpdateIndentLevels ( )
virtual

Recalculate the indent levels for all commands in the list.

Definition at line 361 of file Block.cs.

Member Data Documentation

◆ activeCommand

Command Fungus.Block.activeCommand
protected

Definition at line 48 of file Block.cs.

◆ blockName

string Fungus.Block.blockName = "New Block"
protected

Definition at line 35 of file Block.cs.

◆ commandList

List<Command> Fungus.Block.commandList = new List<Command>()
protected

Definition at line 44 of file Block.cs.

◆ description

string Fungus.Block.description = ""
protected

Definition at line 39 of file Block.cs.

◆ eventHandler

EventHandler Fungus.Block.eventHandler
protected

Definition at line 42 of file Block.cs.

◆ executionCount

int Fungus.Block.executionCount
protected

Definition at line 58 of file Block.cs.

◆ executionInfoSet

bool Fungus.Block.executionInfoSet = false
protected

Definition at line 60 of file Block.cs.

◆ executionState

ExecutionState Fungus.Block.executionState
protected

Definition at line 46 of file Block.cs.

◆ itemId

int Fungus.Block.itemId = -1
protected

Definition at line 31 of file Block.cs.

◆ jumpToCommandIndex

int Fungus.Block.jumpToCommandIndex = -1
protected

Definition at line 56 of file Block.cs.

◆ previousActiveCommandIndex

int Fungus.Block.previousActiveCommandIndex = -1
protected

Definition at line 54 of file Block.cs.

Property Documentation

◆ _EventHandler

virtual EventHandler Fungus.Block._EventHandler
getset

An optional Event Handler which can execute the block when an event occurs.

Note: Using the concrete class instead of the interface here because of weird editor behaviour.

Definition at line 140 of file Block.cs.

◆ ActiveCommand

virtual Command Fungus.Block.ActiveCommand
get

The currently executing command.

Definition at line 145 of file Block.cs.

◆ BlockName

virtual string Fungus.Block.BlockName
getset

The name of the block node as displayed in the Flowchart window.

Definition at line 129 of file Block.cs.

◆ CommandList

virtual List<Command> Fungus.Block.CommandList
get

The list of commands in the sequence.

Definition at line 155 of file Block.cs.

◆ Description

virtual string Fungus.Block.Description
get

Description text to display under the block node

Definition at line 134 of file Block.cs.

◆ ExecutingIconTimer

virtual float Fungus.Block.ExecutingIconTimer
getset

Timer for fading Block execution icon.

Definition at line 150 of file Block.cs.

◆ ItemId

virtual int Fungus.Block.ItemId
getset

Unique identifier for the Block.

Definition at line 124 of file Block.cs.

◆ JumpToCommandIndex

virtual int Fungus.Block.JumpToCommandIndex
set

Controls the next command to execute in the block execution coroutine.

Definition at line 160 of file Block.cs.

◆ State

virtual ExecutionState Fungus.Block.State
get

The execution state of the Block.

Definition at line 119 of file Block.cs.


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