private Tuple<Vector, Stack<RobotMove>> CreateTarget(WaveCell targetCell) { var moves = new Stack<RobotMove>(targetCell.StepNumber+1); var cell = targetCell; while (cell.PrevCell != null) { moves.Push(cell.Move); if(cell.PrevCell.RazorsLeft != cell.RazorsLeft) moves.Push(RobotMove.CutBeard); cell = cell.PrevCell; } return Tuple.Create(targetCell.Pos, moves); }
public WaveCell(Vector pos, int stepNumber, WaveCell prevCell, RobotMove move, int waterproofLeft, int razorsLeft) { Pos = pos; StepNumber = stepNumber; PrevCell = prevCell; Move = move; WaterproofLeft = waterproofLeft; RazorsLeft = razorsLeft; }