class MAGES::SceneGraphModule

Overview

The scene graph module base class. More…

class SceneGraphModule: public MAGES::HubModule
{
public:
    // enums

    enum ActionCategory;

    // properties

    AudioClip PerformSound;
    AudioClip UndoSound;
    GameObject InfoUI;
    GameObject WarningUI;
    GameObject AchievementUI;
    GameObject ErrorUI;
    Material HolographicMaterial;

    // methods

    delegate void ActionInitializedEvent(BaseActionData data);
    delegate void ActionPerformedEvent(BaseActionData data, bool skipped);
    delegate void ActionUndoneEvent(BaseActionData data);

    delegate void ActionStateChangeEvent(
        BaseActionData data,
        ActionState previousState,
        ActionState newState
    );

    virtual abstract void SkipAction(BaseActionData action) = 0;
    virtual abstract void UndoAction(BaseActionData action) = 0;
    virtual abstract void Skip() = 0;
    virtual abstract void Undo() = 0;
    virtual abstract ActionCategory GetActionCategory(BaseActionData action) = 0;
    virtual abstract SceneGraphModule ActionInitialized(ActionInitializedEvent action) = 0;
    virtual abstract SceneGraphModule ActionPerformed(ActionPerformedEvent action) = 0;
    virtual abstract SceneGraphModule ActionUndone(ActionUndoneEvent action) = 0;
    virtual abstract SceneGraphModule ForEachAction(Action<BaseActionData> action) = 0;
};

// direct descendants

class MAGESSceneGraph;
class StubSceneGraph;

Inherited Members

public:
    // methods

    virtual abstract void Startup() = 0;
    virtual abstract void Shutdown() = 0;

Detailed Documentation

The scene graph module base class.

Properties

AudioClip PerformSound

Gets the perform sound.

AudioClip UndoSound

Gets the undo sound.

GameObject InfoUI

Gets the info UI.

GameObject WarningUI

Gets the warning UI.

GameObject AchievementUI

Gets the warning UI.

GameObject ErrorUI

Gets the error UI.

Material HolographicMaterial

Gets or sets the holographic material for the operation.

Methods

delegate void ActionInitializedEvent(BaseActionData data)

Called when the action is initialized.

Parameters:

data

The action data.

delegate void ActionPerformedEvent(BaseActionData data, bool skipped)

Called when the action is performed.

Parameters:

data

The action data.

skipped

Whether the action was skipped.

delegate void ActionUndoneEvent(BaseActionData data)

Called when the action is undone.

Parameters:

data

The action data.

delegate void ActionStateChangeEvent(
    BaseActionData data,
    ActionState previousState,
    ActionState newState
)

Called before an action’s state is changed.

Parameters:

data

The action.

previousState

The previous state.

newState

The new state.

virtual abstract void SkipAction(BaseActionData action) = 0

Skips a specific action.

Parameters:

action

The action to be skipped.

virtual abstract void UndoAction(BaseActionData action) = 0

Undo a specific action.

Parameters:

action

The action to be undone.

virtual abstract void Skip() = 0

General version of SkipAction(BaseActionData). This will perform/skip all the currently running actions.

virtual abstract void Undo() = 0

General version of UndoAction(BaseActionData). This will undo all the running actions, as well as the previous ones.

virtual abstract ActionCategory GetActionCategory(BaseActionData action) = 0

Gets the action category.

Parameters:

action

The action.

Returns:

The category of the action.

virtual abstract SceneGraphModule ActionInitialized(ActionInitializedEvent action) = 0

Add event listener for when an action is initialized.

Parameters:

action

The delegate to invoke.

Returns:

The module.

virtual abstract SceneGraphModule ActionPerformed(ActionPerformedEvent action) = 0

Add event listener for when an action is performed.

Parameters:

action

The delegate to invoke.

Returns:

The module.

virtual abstract SceneGraphModule ActionUndone(ActionUndoneEvent action) = 0

Add event listener for when an action is reverted.

Parameters:

action

The delegate to invoke.

Returns:

The module.

virtual abstract SceneGraphModule ForEachAction(Action<BaseActionData> action) = 0

Iterate through all the actions.

Parameters:

action

The action to invoke for each action.

Returns:

The module.