예제 #1
0
 internal TileGroupManager(TilesetManager tilesetManager)
 {
     foreach (string tilegroup in tilesetManager.Groups)
     {
         TileGroups[tilegroup] = new TileGroupChild(tilegroup, tilesetManager.Tilesets);
     }
 }
 internal TileGroupManager(TilesetLoader tilesetLoader)
 {
     foreach (string labelGroup in tilesetLoader.Groups)
     {
         TileGroups[labelGroup] = new TileGroupChild(labelGroup, tilesetLoader.Tilesets);
     }
 }
예제 #3
0
        /// <summary>
        /// Creates a new tilegroup and transfers ownership of all Categories
        /// and Descriptors from their previous Group to the specified new
        /// Group. Called by XCMainWindow.OnEditGroupClick()
        /// NOTE: Check if the group and category already exist first.
        /// </summary>
        /// <param name="labelGroup">the new label for the group</param>
        /// <param name="labelGroupPre">the old label of the group</param>
        public void EditTileGroup(string labelGroup, string labelGroupPre)
        {
            TileGroups[labelGroup] = new TileGroupChild(labelGroup);

            foreach (var labelCategory in TileGroups[labelGroupPre].Categories.Keys)
            {
                TileGroups[labelGroup].AddCategory(labelCategory);

                foreach (var descriptor in TileGroups[labelGroupPre].Categories[labelCategory].Values)
                {
                    TileGroups[labelGroup].Categories[labelCategory][descriptor.Label] = descriptor;
                }
            }
            DeleteTileGroup(labelGroupPre);
        }
예제 #4
0
 /// <summary>
 /// Adds a group. Called by XCMainWindow.OnAddGroupClick()
 /// NOTE: Check if the group already exists first.
 /// </summary>
 /// <param name="labelGroup">the label of the group to add</param>
 public void AddTileGroup(string labelGroup)
 {
     TileGroups[labelGroup] = new TileGroupChild(labelGroup, new List <Tileset>());
 }