44namespace Celeste . Mod . SpringCollab2020 {
55 class SpringCollab2020MapDataProcessor : EverestMapDataProcessor {
66
7- // the structure here is: FlagTouchSwitches[AreaID ][ModeID][flagName] = list of entity ids for flag touch switches in this group on this map.
8- public static List < List < Dictionary < string , List < EntityID > > > > FlagTouchSwitches = new List < List < Dictionary < string , List < EntityID > > > > ( ) ;
7+ // the structure here is: FlagTouchSwitches[AreaSID ][ModeID][flagName] = list of entity ids for flag touch switches in this group on this map.
8+ public static Dictionary < string , List < Dictionary < string , List < EntityID > > > > FlagTouchSwitches = new Dictionary < string , List < Dictionary < string , List < EntityID > > > > ( ) ;
99 private string levelName ;
1010
1111 // we want to match multi-room strawberry seeds with the strawberry that has the same name.
@@ -23,11 +23,10 @@ class SpringCollab2020MapDataProcessor : EverestMapDataProcessor {
2323 levelName = levelName . Substring ( 4 ) ;
2424 }
2525 }
26- } ,
27- {
26+ } , {
2827 "entity:SpringCollab2020/FlagTouchSwitch" , flagTouchSwitch => {
2928 string flag = flagTouchSwitch . Attr ( "flag" ) ;
30- Dictionary < string , List < EntityID > > allTouchSwitchesInMap = FlagTouchSwitches [ AreaKey . ID ] [ ( int ) AreaKey . Mode ] ;
29+ Dictionary < string , List < EntityID > > allTouchSwitchesInMap = FlagTouchSwitches [ AreaKey . SID ] [ ( int ) AreaKey . Mode ] ;
3130
3231 // if no dictionary entry exists for this flag, create one. otherwise, get it.
3332 List < EntityID > entityIDs ;
@@ -71,17 +70,17 @@ class SpringCollab2020MapDataProcessor : EverestMapDataProcessor {
7170 }
7271
7372 public override void Reset ( ) {
74- while ( FlagTouchSwitches . Count <= AreaKey . ID ) {
75- // fill out the empty space before the current map with empty dictionaries .
76- FlagTouchSwitches . Add ( new List < Dictionary < string , List < EntityID > > > ( ) ) ;
73+ if ( ! FlagTouchSwitches . ContainsKey ( AreaKey . SID ) ) {
74+ // create an entry for the current map SID .
75+ FlagTouchSwitches [ AreaKey . SID ] = new List < Dictionary < string , List < EntityID > > > ( ) ;
7776 }
78- while ( FlagTouchSwitches [ AreaKey . ID ] . Count <= ( int ) AreaKey . Mode ) {
77+ while ( FlagTouchSwitches [ AreaKey . SID ] . Count <= ( int ) AreaKey . Mode ) {
7978 // fill out the empty space before the current map MODE with empty dictionaries.
80- FlagTouchSwitches [ AreaKey . ID ] . Add ( new Dictionary < string , List < EntityID > > ( ) ) ;
79+ FlagTouchSwitches [ AreaKey . SID ] . Add ( new Dictionary < string , List < EntityID > > ( ) ) ;
8180 }
8281
8382 // reset the dictionary for the current map and mode.
84- FlagTouchSwitches [ AreaKey . ID ] [ ( int ) AreaKey . Mode ] = new Dictionary < string , List < EntityID > > ( ) ;
83+ FlagTouchSwitches [ AreaKey . SID ] [ ( int ) AreaKey . Mode ] = new Dictionary < string , List < EntityID > > ( ) ;
8584 }
8685
8786 public override void End ( ) {
0 commit comments