Exemple #1
0
        public void NextStep(State state, Trace trace)
        {
            //if (state.Bots.Length != trace.Count)
            //    throw new Exception("Commands count should be equal to bots count");

            UpdateEnergy(state);

            allCommands.AddRange(trace);

            while (trace.Any())
            {
                var bots     = state.Bots.ToList();
                var commands = trace.Dequeue(bots.Count);
                Execute(state, bots.Zip(commands, (x, y) => (x, y)).ToList());
            }
        }
Exemple #2
0
 public IEnumerable <ICommand> NextStep(State state)
 {
     return(commands.Dequeue(state.Bots.Length));
 }