Exemple #1
0
        private async Task ProcessInput(Keys cmd, string keyString)
        {
            if (cmd == Keys.None)
            {
                return;
            }

            lastInput = cmd;

            int waitTime = 700;

            if (IsCursorMovement(cmd))
            {
                await ExecuteCursorMovement(cmd);

                return;
            }

            var command = commands.FindCommand(keyString);

            if (command != null)
            {
                commands.CurrentCommand = command;

                await textArea.Print(command.Name);

                await command.Execute();
            }
            else
            {
                soundMan.PlaySound(LotaSound.Invalid);

                await gameControl.WaitAsync(waitTime);

                inputPrompt = true;
                return;
            }

            await AfterDoCommand(waitTime, cmd);
        }
Exemple #2
0
 public void PlaySound(LotaSound lotaSound, float volume = 1)
 {
     soundMan.PlaySound(lotaSound, volume);
 }