Пример #1
0
        private void _RunState(string state)
        {
            Logger.Info($"{currentState.Value} => {state}");

            if (currentState.Value == state)
            {
                return;
            }

            switch (state)
            {
            case State.SETUP:
                currentStateModule = new SetupState();
                currentStateModule.Toggle();
                break;

            case State.PLAY:
                var wordsFilePath = Path.Combine(PersistentDataPath, "Ch.txt");
                var config        = new PlayStateConfiguration()
                {
                    Words = WordFileReader.GetWords(wordsFilePath)
                };
                currentStateModule = new PlayState(config);
                currentStateModule.Toggle();
                break;
            }
            currentState.Value = state;
        }
Пример #2
0
 private void Change(IModuleState moduleState)
 {
     _moduleState = moduleState;
 }
Пример #3
0
 public ModuleContext(IModuleState moduleState)
 {
     _moduleState = moduleState;
 }