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()); } }
public IEnumerable <ICommand> NextStep(State state) { return(commands.Dequeue(state.Bots.Length)); }