GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Data

Data

Jump to bottom
GMIKE edited this page Jun 2, 2020 · 11 revisions

Data it's collection of keys and values Data need for sharing between states.

Сontent

  • Create
  • Get
  • Exists
  • Delete
  • Change

Create

//Throw exeption if data already exist
Data data = stateMachine.AddData("Key1", Value1);

//Return null if data already exist
Data data = stateMachine.TryAddData(out bool result, "Key1", Value1);

Get

//Throw exeption if data not found
Data data = stateMachine.GetData("Key1");

//Return null if data not found
Data data = stateMachine.TryGetData("Key1", out bool result);

Exists

//You can check on exists
bool dataKey1IsExists = stateMachine.DataExists("key1")

Delete

Delete with name

//Throw exeption if data not found
stateMachine.DeleteData("Key1");

stateMachine.TryDeleteData("Key1", out bool result);;

Delete with object

//Throw exeption if state not found
stateMachine.DeleteState(state1);

stateMachine.TryDeleteState(state1);

//Throw exeption if data already delete from state machine
data.Delete();

data.TryDelete(out bool result);

Change

Action Syntax

void ActionOnChange(Data data, object newValue)
{

}

Add action

//you can set action with add
Data data = stateMachine.AddData("Key1", Value1, ActionOnChange);

//you can set action after add
Data data = stateMachine.TryAddData(out bool result, "Key1", Value1, ActionOnChange);

data.OnChange(ActionOnChange);
  

Documentation

  • StateMachine
  • State
  • Transition
  • Data

Clone this wiki locally

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.