public EditMapChipController(MapData mapData)
     : base(mapData)
 {
 }
Example #2
0
 public TurnController(MapData mapData)
     : base(mapData)
 {
 }
Example #3
0
        public void Edit <T>(IAssetData asset)
        {
            foreach (string name in mapCollectionData.mapDataDict.Keys)
            {
                if (asset.AssetNameEquals("Maps/" + name))
                {
                    Monitor.Log("Editing map " + asset.AssetName);
                    var     mapData = asset.AsMap();
                    MapData data    = mapCollectionData.mapDataDict[name];
                    int     count   = 0;
                    foreach (var kvp in data.tileDataDict)
                    {
                        foreach (Layer layer in mapData.Data.Layers)
                        {
                            if (layer.Id == "Paths")
                            {
                                continue;
                            }
                            try
                            {
                                layer.Tiles[(int)kvp.Key.X, (int)kvp.Key.Y] = null;
                            }
                            catch
                            {
                            }
                        }
                        foreach (var kvp2 in kvp.Value.tileDict)
                        {
                            try
                            {
                                List <StaticTile> tiles = new List <StaticTile>();
                                for (int i = 0; i < kvp2.Value.tiles.Count; i++)
                                {
                                    TileInfo tile = kvp2.Value.tiles[i];
                                    tiles.Add(new StaticTile(mapData.Data.GetLayer(kvp2.Key), mapData.Data.GetTileSheet(tile.tileSheet), tile.blendMode, tile.tileIndex));
                                    foreach (var prop in kvp2.Value.tiles[i].properties)
                                    {
                                        tiles[i].Properties[prop.Key] = prop.Value;
                                    }
                                }

                                if (kvp2.Value.tiles.Count == 1)
                                {
                                    mapData.Data.GetLayer(kvp2.Key).Tiles[(int)kvp.Key.X, (int)kvp.Key.Y] = tiles[0];
                                }
                                else
                                {
                                    mapData.Data.GetLayer(kvp2.Key).Tiles[(int)kvp.Key.X, (int)kvp.Key.Y] = new AnimatedTile(mapData.Data.GetLayer(kvp2.Key), tiles.ToArray(), kvp2.Value.frameInterval);
                                }
                                count++;
                            }
                            catch
                            {
                            }
                        }
                    }
                    Monitor.Log($"Added {count} custom tiles to map {name}");
                    cleanMaps.Add(name);
                }
            }
        }
Example #4
0
 public ConvertDataController(MapData mapData)
     : base(mapData)
 {
 }
Example #5
0
 protected MapDataController(MapData mapData)
 {
     this.mapData = mapData;
 }
 public ChangeMapSizeController(MapData mapData)
     : base(mapData)
 {
 }