Beispiel #1
0
        public override async Task Execute()
        {
            this.Priority = 30;
            while (true)
            {
                NextAction = GetAction();

                if (await TurnSystem.NextTurn())
                {
                    continue;
                }

                var action = NextAction;
                // Robot actions are more important than players
                // so if it's Nop, just don't broadcast
                if (action != Levels.Action.Nop)
                {
                    ActionController.Broadcast(action, user: false);
                }
            }
        }
Beispiel #2
0
        public override async Task Execute()
        {
            Script.AddTask(ProcessInput);
            while (true)
            {
                if (await TurnSystem.NextTurn())
                {
                    Reset();
                    continue;
                }

                var action = NextAction;

                // Check if the action is allowed before broadcasting it.
                if (userActions.Contains(action.GetActionType()))
                {
                    ActionController.Broadcast(action, user: true);
                }

                Reset();
            }
        }