public bool IsFreeInDirection(IPlacableActor actor, string direction) { var location = Map.GetActorCoordinates(actor); switch (direction) { case "Up": location._y--; break; case "Down": location._y++; break; case "Left": location._x--; break; case "Right": location._x++; break; } if (Map.At(location).Actor != null) { return(false); } if (!Map.At(location).IsPassable()) { return(false); } return(true); }
public void Move(IPlacableActor self, string direction) { var location = Map.GetActorCoordinates(self); Map.At(location).Actor = null; switch (direction) { case "Up": location._y--; break; case "Down": location._y++; break; case "Left": location._x--; break; case "Right": location._x++; break; } Map.At(location).Actor = self; }
public IActor ActorInDirection(IPlacableActor actor, string direction) { var location = Map.GetActorCoordinates(actor); switch (direction) { case "Up": location._y--; break; case "Down": location._y++; break; case "Left": location._x--; break; case "Right": location._x++; break; } return(Map.At(location).Actor); }
public void PlaceActorToGrid(IPlacableActor actor, Vector v) { Map.Grid [v._x] [v._y].Actor = actor; }
public void PlaceActorToGrid(IPlacableActor actor) { Map.Grid [actor.InitialX] [actor.InitialY].Actor = actor; }
public void Attack(IPlacableActor self, string direction) { // What should happen here? }