コード例 #1
0
        public IWorldCommand Excecute()
        {
            ITile tile = level.GetTileAt(posX, posY);

            if (tile.HasFurniture())
            {
                return(NullCommand.instance);
            }

            tile.PlaceFurniture(furniture);
            return(new RemoveFurnitureCommand(level, posX, posY));
        }
コード例 #2
0
        public override void Move(int xOffset, int yOffset)
        {
            ITile destination = level.GetTileAt(parent.X + xOffset, parent.Y + yOffset);

            if (destination.HasFurniture() == false)
            {
                parent.RemoveFurniture();

                destination.PlaceFurniture(this);
                parent = destination;
            }

            OnMove(xOffset, yOffset);
        }
コード例 #3
0
        public IWorldCommand Excecute()
        {
            ITile tile = level.GetTileAt(posX, posY);

            if (tile.HasFurniture() == false)
            {
                return(NullCommand.instance);
            }

            IFurniture previousFurniture = tile.GetPlacedFurniture();

            tile.RemoveFurniture();

            return(new PlaceFurnitureCommand(level, posX, posY, previousFurniture));
        }