4
4
namespace Celeste . Mod . SpringCollab2020 {
5
5
class SpringCollab2020MapDataProcessor : EverestMapDataProcessor {
6
6
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 > > > > ( ) ;
9
9
private string levelName ;
10
10
11
11
// we want to match multi-room strawberry seeds with the strawberry that has the same name.
@@ -23,11 +23,10 @@ class SpringCollab2020MapDataProcessor : EverestMapDataProcessor {
23
23
levelName = levelName . Substring ( 4 ) ;
24
24
}
25
25
}
26
- } ,
27
- {
26
+ } , {
28
27
"entity:SpringCollab2020/FlagTouchSwitch" , flagTouchSwitch => {
29
28
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 ] ;
31
30
32
31
// if no dictionary entry exists for this flag, create one. otherwise, get it.
33
32
List < EntityID > entityIDs ;
@@ -71,17 +70,17 @@ class SpringCollab2020MapDataProcessor : EverestMapDataProcessor {
71
70
}
72
71
73
72
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 > > > ( ) ;
77
76
}
78
- while ( FlagTouchSwitches [ AreaKey . ID ] . Count <= ( int ) AreaKey . Mode ) {
77
+ while ( FlagTouchSwitches [ AreaKey . SID ] . Count <= ( int ) AreaKey . Mode ) {
79
78
// 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 > > ( ) ) ;
81
80
}
82
81
83
82
// 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 > > ( ) ;
85
84
}
86
85
87
86
public override void End ( ) {
0 commit comments