public static void deleteState(uint mIDState, gameContext gc) { AState selectedState; stateChoice selectedStateChoice; uint?keyCurrent = 0; foreach (thread th in gc.Threads) { foreach (KeyValuePair <uint?, IState> st in th.MIDToIState) { keyCurrent = st.Key; selectedState = (AState)st.Value; if ((st.Value as stateChoice) == null) { // delete the state from nextStates foreach (uint?nextState in selectedState.MNextStates) { if (nextState == mIDState) { List <uint?> tmp = new List <uint?>(selectedState.MNextStates); tmp.Remove(nextState); selectedState.MNextStates = tmp.ToArray(); } } } else { // for stateChoice we delete the state from nextStates and the corresponding variant from choicesList foreach (uint?nextState in selectedState.MNextStates) { if (nextState == mIDState) { selectedStateChoice = (stateChoice)st.Value; List <uint?> tmp = new List <uint?>(selectedStateChoice.MNextStates); int ind = tmp.IndexOf(nextState); tmp.Remove(nextState); selectedStateChoice.MNextStates = tmp.ToArray(); List <Choice> tmp1 = new List <Choice>(selectedStateChoice.MChoices); tmp1.RemoveAt(ind); selectedStateChoice.MChoices = tmp1.ToArray(); } } } } } // delete the state gc.Threads[0].deleteState(mIDState); Form1.form1.loadToStateList(); }
public drawFullScreen(gameContext inputGC, Control inputCanvas) : base(inputGC, inputCanvas) { }
public drawChoice(gameContext inputGC, Control inputCanvas) : base(inputGC, inputCanvas) { }
public drawDialogue(gameContext inputGC, Control inputCanvas) : base(inputGC, inputCanvas) { }
public ADrawInterface(gameContext inputGC, Control inputCanvas) : base() { gc = inputGC; canvas = inputCanvas; }
public drawWait(gameContext inputGC, Control inputCanvas) : base(inputGC, inputCanvas) { }