Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 16
Data
GMIKE edited this page Jun 2, 2020
·
11 revisions
Data it's collection of keys and values Data need for sharing between states.
//Throw exeption if data already existDatadata=stateMachine.AddData("Key1",Value1);//Return null if data already existDatadata=stateMachine.TryAddData(outboolresult,"Key1",Value1);//Throw exeption if data not foundDatadata=stateMachine.GetData("Key1");//Return null if data not foundDatadata=stateMachine.TryGetData("Key1",outboolresult);//You can check on existsbooldataKey1IsExists=stateMachine.DataExists("key1")//Throw exeption if data not foundstateMachine.DeleteData("Key1");stateMachine.TryDeleteData("Key1",outboolresult);;//Throw exeption if state not foundstateMachine.DeleteState(state1);stateMachine.TryDeleteState(state1);//Throw exeption if data already delete from state machinedata.Delete();data.TryDelete(outboolresult);voidActionOnChange(Datadata,objectnewValue){}//you can set action with addDatadata=stateMachine.AddData("Key1",Value1,ActionOnChange);//you can set action after addDatadata=stateMachine.TryAddData(outboolresult,"Key1",Value1,ActionOnChange);data.OnChange(ActionOnChange);