示例#1
0
        public Tile(int x, int y, Material type, World world)
            : base(x, y, C.TILE_WIDTH, C.TILE_HEIGHT, PVResources.MaterialImageMap[type])
        {
            X = x;
            Y = y;

            _Material = type;
            // Remove underlying tile (before we add this tile)
            WorldHelper.RemoveTileAtPoint(X, Y);
            world.Tiles.Add(this);
            _Image = PVResources.MaterialImageMap[_Material];
        }
示例#2
0
 private void _TriggerSelectedWorldTool(Rectangle click)
 {
     if (SELECTED_WORLDTOOL == WorldTool.TILE)
     {
         new Tile(C.round(C.MX, 64), C.round(C.MY, 64), ToolBarButton.SELECTED_TOOL.GetSelectedOption().GetMaterial(), Game.World);
     }
     else if (SELECTED_WORLDTOOL == WorldTool.FUNCTION_TILE)
     {
         new FunctionTile(C.round(C.MX, 64), C.round(C.MY, 64), ToolBarButton.SELECTED_TOOL.GetSelectedOption().GetMaterial(), Game.World);
     }
     else if (SELECTED_WORLDTOOL == WorldTool.STRUCTURE_TILE)
     {
         new StructureTile(C.round(C.MX, 64), C.round(C.MY, 64), ToolBarButton.SELECTED_TOOL.GetSelectedOption().GetMaterial(), Game.World);
     }
     else if (SELECTED_WORLDTOOL == WorldTool.ERASER)
     {
         WorldHelper.RemoveTileAtPoint(click);
     }
 }