/// <summary> /// Adds an action to the list /// Given that only face commands, pause, and stop will be given any double-face commands will /// be transmuted into a walk /// </summary> /// <param name="a">incoming action</param> public static void AddAction(PokeEngine.Trainers.Action a) { actions.Add(a); }
private static void AlterTempNPC(PokeEngine.Trainers.Action action) { int x = tempNPC.tileCoords.X; int y = tempNPC.tileCoords.Y; switch (action) { case PokeEngine.Trainers.Action.LEFT: if (x - 1 >= 0) { if (map.tile[x - 1, y].isAccessibleFrom(Direction.East)) { tempNPC.tileCoords.X -= 1; } } break; case PokeEngine.Trainers.Action.RIGHT: if (x + 1 < map.mapWidth) { if (map.tile[x + 1, y].isAccessibleFrom(Direction.West)) { tempNPC.tileCoords.X += 1; } } break; case PokeEngine.Trainers.Action.UP: if (y - 1 >= 0) { if (map.tile[x, y - 1].isAccessibleFrom(Direction.South)) { tempNPC.tileCoords.Y -= 1; } } break; case PokeEngine.Trainers.Action.DOWN: if (y + 1 < map.mapHeight) { if (map.tile[x, y + 1].isAccessibleFrom(Direction.North)) { tempNPC.tileCoords.Y += 1; } } break; case PokeEngine.Trainers.Action.FACELEFT: tempNPC.facing = FacingDirection.West; tempNPC.Update(); break; case PokeEngine.Trainers.Action.FACERIGHT: tempNPC.facing = FacingDirection.East; tempNPC.Update(); break; case PokeEngine.Trainers.Action.FACEUP: tempNPC.facing = FacingDirection.North; tempNPC.Update(); break; case PokeEngine.Trainers.Action.FACEDOWN: tempNPC.facing = FacingDirection.South; tempNPC.Update(); break; } }