示例#1
0
 public Layer Clone()
 {
     var lyr = new Layer();
     lyr.LayerName = (string)LayerName.Clone();
     lyr.Map = (Map)Map.Clone();
     lyr.Visible = Visible;
     return lyr;
 }
示例#2
0
 public override MapState Execute(MapState state, Selection selection)
 {
     var newLayer = new Layer() { LayerName = "New layer", Map = (Map)state.ActiveLayer.Map.Clone(), Visible=true };
     foreach (var tile in newLayer.Map.GetAllTiles())
     {
         tile.IsEmpty = true;
         foreach (var c in selection)
             if (c.X == tile.X && c.Y == tile.Y)
                 tile.IsEmpty = false;
     }
     state.Selection = new Selection();
     state.Layers.Insert(0, newLayer);
     //state.ActiveLayer.Visible = false;
     state.ActiveLayer = state.Layers[0];
     return state;
 }