public void execute(Action a, Wrappy w) { Move(a, w); if (w.remainingFastWheel > 0) { w.remainingFastWheel--; updateStatus(w); Move(a, w); } if (w.remainingDrill > 0) { w.remainingDrill--; //map[w.Loc.x, w.loc.y] = Tile.Filled; // already done by updatemap } if (a.IsE) { w.rotateClockwise(); } if (a.IsQ) { w.rotateAntiClockwise(); } if (a.IsB) { if (!collectedBoosters.Remove(Booster.Manipulator)) { throw new Exception("Missing manipulator boost"); } Action.B b = (Action.B)a; w.Manips.Add(new Point(b.Item1, b.Item2)); // TODO: checkare che il punto sia davvero adiacente } if (a.IsF) { if (!collectedBoosters.Remove(Booster.FastWheels)) { throw new Exception("Missing fast wheel boost"); } w.remainingFastWheel += 50; } if (a.IsL) { if (!collectedBoosters.Remove(Booster.Drill)) { throw new Exception("Missing Drill boost"); } w.remainingDrill += 30; } if (a.IsR)//telepor { throw new Exception("Teleport not implemented yet"); } if (a.IsC) { if (!collectedBoosters.Remove(Booster.Cloning)) { throw new Exception("Missing Cloning boost"); } if (boosters.Find((kvp) => kvp.Value.Equals(w.Loc)).Key != Booster.CloningPlatform) { throw new Exception("Cloning not in a platform"); } wrappies.Add(new Wrappy(w.Loc)); } w.ActionHistory.Add(a); updateStatus(w); }