public bool MoveToDirection(Utils.PolarDirection dir) { if (_movementPoints <= 0) { Debug.Log("Cannot move. Insufficient movementPoints"); return(false); } Vector2Int newMapPosition = _mapPosition + Utils.ToCoordIncrement(dir); if (!Utils.IsOnMap(newMapPosition)) { Debug.Log("Cannot move out of the map"); return(false); } --_movementPoints; _direction = dir; _mapPosition = newMapPosition; return(true); }
public void Rotate(Utils.PolarDirection dir) { _direction = dir; }