示例#1
0
        public void TeleportImpl(ExtractedParameters parameters)
        {
            var dispatchee  = parameters.GetDispatchee("Dispatchee", Registry);
            var coordinates = _tiles.RandomEmptyTile();

            PlaceInMaze(dispatchee, coordinates);
        }
示例#2
0
        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);
        }