private void CheckPositionIsDefault(IHaveCoordinates toCheck) { if (_state.Cells[toCheck.X, toCheck.Y] != CellType.Default) { throw new PositionAlreadyTakenException(toCheck.X, toCheck.Y, _state.Cells[toCheck.X, toCheck.Y]); } }
public void MoveTo(IHaveCoordinates newPosition) { X = newPosition.X; Y = newPosition.Y; MovesUntilDeath--; }
public void Eat(IHaveCoordinates herbivore) { X = herbivore.X; Y = herbivore.Y; MovesUntilDeath = MovesLeftAfterEating; }
public static IEnumerable <Coordinate> GetSurroundingCells(this IHaveCoordinates instance, int distance, int numberOfRows, int numberOfColumns) { return(Coordinate.GetSurroundingCells(instance.X, instance.Y, distance, numberOfRows, numberOfColumns)); }