public RhythmCore.RhythmExpectedEventInfo GenerateExpectedEvent_A(MutexArrowNoRepeatStrat_A strat) { RhythmCore.RhythmExpectedEventInfo ret; if (strat == this._genStratA) { // Generate a non-repeating prompt arrow direction this.currInfoA = RandomArrowGenStrat.GenerateExpectedEventStatic(); if (_myState == State.WAITING_FOR_FIRST) { while (this.currInfoA.expectedKey == this.prevInfoA.expectedKey) { this.currInfoA = RandomArrowGenStrat.GenerateExpectedEventStatic(); } this._myState = State.A_REQUESTED_B_PENDING; //Debug.Log("GenerateExpectedEvent_A -> A_REQUESTED_B_PENDING"); } else if (_myState == State.B_REQUESTED_A_PENDING) { while (this.currInfoA.expectedKey == this.prevInfoA.expectedKey || this.currInfoA.expectedKey == this.currInfoB.expectedKey) { this.currInfoA = RandomArrowGenStrat.GenerateExpectedEventStatic(); } this._myState = State.WAITING_FOR_FIRST; //Debug.Log("GenerateExpectedEvent_A -> WAITING_FOR_FIRST"); } else { Debug.LogError("Invalid state in MutexArrowCoordinator.GenerateExpectedEvent_A"); } // Set this.prevInfo to track the previous key this strategy generated this.prevInfoA = this.currInfoA; // Return ret = this.currInfoA; } else { Debug.LogError("MutexArrowNoRepeatStrat_A passed into GenerateExpectedEvent_A does not match registered strategy"); ret = new RhythmCore.RhythmExpectedEventInfo() { expectedKey = KeyCode.A }; } return(ret); }
public static RhythmCore.RhythmExpectedEventInfo GenerateExpectedEventStatic(ref RhythmCore.RhythmExpectedEventInfo prev) { // Generate a non-repeating prompt arrow direction RhythmCore.RhythmExpectedEventInfo retInfo = RandomArrowGenStrat.GenerateExpectedEventStatic(); while (retInfo.expectedKey == prev.expectedKey) { retInfo = RandomArrowGenStrat.GenerateExpectedEventStatic(); } // Set this.prevInfo to track the previous key this strategy generated prev = retInfo; // Return return(retInfo); }