//Check if this entity is in the given direction of the given other entity public bool isInDirection(Entity entity, Entity.Direction direction) { System.Drawing.Point point = getCoordinatesFromDirection(entity, direction); if (point.Y == this.y && point.X == this.x) { return(true); } return(false); }
public void ArrowKeyAction(Entity.Direction direction) { System.Drawing.Point point = Entity.getCoordinatesFromDirection(player, direction); //Add the action to the undo/redo stack and execute it if (map.isWalkable(point.X, point.Y)) { undoRedoController.AddAndExecute(new ArrowKeyActionCommand(this, direction)); Update(); } }