diff options
Diffstat (limited to 'utils/assign_ids.rb')
-rw-r--r-- | utils/assign_ids.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/utils/assign_ids.rb b/utils/assign_ids.rb index 9e1ce67..f7de3d0 100644 --- a/utils/assign_ids.rb +++ b/utils/assign_ids.rb | |||
@@ -73,6 +73,22 @@ if old_generated.include? "door_groups" then | |||
73 | end | 73 | end |
74 | end | 74 | end |
75 | end | 75 | end |
76 | if old_generated.include? "panel_doors" then | ||
77 | old_generated["panel_doors"].each do |room, panel_doors| | ||
78 | panel_doors.each do |name, id| | ||
79 | if id >= next_item_id then | ||
80 | next_item_id = id + 1 | ||
81 | end | ||
82 | end | ||
83 | end | ||
84 | end | ||
85 | if old_generated.include? "panel_groups" then | ||
86 | old_generated["panel_groups"].each do |name, id| | ||
87 | if id >= next_item_id then | ||
88 | next_item_id = id + 1 | ||
89 | end | ||
90 | end | ||
91 | end | ||
76 | if old_generated.include? "progression" then | 92 | if old_generated.include? "progression" then |
77 | old_generated["progression"].each do |name, id| | 93 | old_generated["progression"].each do |name, id| |
78 | if id >= next_item_id then | 94 | if id >= next_item_id then |
@@ -82,6 +98,7 @@ if old_generated.include? "progression" then | |||
82 | end | 98 | end |
83 | 99 | ||
84 | door_groups = Set[] | 100 | door_groups = Set[] |
101 | panel_groups = Set[] | ||
85 | 102 | ||
86 | config = YAML.load_file(configpath) | 103 | config = YAML.load_file(configpath) |
87 | config.each do |room_name, room_data| | 104 | config.each do |room_name, room_data| |
@@ -163,6 +180,29 @@ config.each do |room_name, room_data| | |||
163 | end | 180 | end |
164 | end | 181 | end |
165 | 182 | ||
183 | if room_data.include? "panel_doors" | ||
184 | room_data["panel_doors"].each do |panel_door_name, panel_door| | ||
185 | unless old_generated.include? "panel_doors" and old_generated["panel_doors"].include? room_name and old_generated["panel_doors"][room_name].include? panel_door_name then | ||
186 | old_generated["panel_doors"] ||= {} | ||
187 | old_generated["panel_doors"][room_name] ||= {} | ||
188 | old_generated["panel_doors"][room_name][panel_door_name] = next_item_id | ||
189 | |||
190 | next_item_id += 1 | ||
191 | end | ||
192 | |||
193 | if panel_door.include? "panel_group" and not panel_groups.include? panel_door["panel_group"] then | ||
194 | panel_groups.add(panel_door["panel_group"]) | ||
195 | |||
196 | unless old_generated.include? "panel_groups" and old_generated["panel_groups"].include? panel_door["panel_group"] then | ||
197 | old_generated["panel_groups"] ||= {} | ||
198 | old_generated["panel_groups"][panel_door["panel_group"]] = next_item_id | ||
199 | |||
200 | next_item_id += 1 | ||
201 | end | ||
202 | end | ||
203 | end | ||
204 | end | ||
205 | |||
166 | if room_data.include? "progression" | 206 | if room_data.include? "progression" |
167 | room_data["progression"].each do |progression_name, pdata| | 207 | room_data["progression"].each do |progression_name, pdata| |
168 | unless old_generated.include? "progression" and old_generated["progression"].include? progression_name then | 208 | unless old_generated.include? "progression" and old_generated["progression"].include? progression_name then |