public void TeleportImpl(ExtractedParameters parameters) { var dispatchee = parameters.GetDispatchee("Dispatchee", Registry); var coordinates = _tiles.RandomEmptyTile(); PlaceInMaze(dispatchee, coordinates); }
public void MoveImpl(ExtractedParameters parameters) { var dispatchee = parameters.GetDispatchee("Dispatchee", Registry); var direction = parameters.ToValue <Compass8Points>("Direction"); var newCoordinates = dispatchee.Coordinates.Move(direction); if (!_tiles.IsInside(newCoordinates)) { return; } if (!_tiles[newCoordinates].IsNullOrEmpty()) { return; } PlaceInMaze(dispatchee, newCoordinates); }