@@ -19,10 +19,10 @@ public partial class ClassBase : DatabaseObject<ClassBase>, IFolderable
1919 public const long DEFAULT_EXPERIENCE_INCREASE = 50 ;
2020
2121 [ NotMapped ]
22- public int [ ] BaseStat = new int [ ( int ) Stat . StatCount ] ;
22+ public int [ ] BaseStat = new int [ Enum . GetValues < Stat > ( ) . Length ] ;
2323
2424 [ NotMapped ]
25- public int [ ] BaseVital = new int [ ( int ) Vital . VitalCount ] ;
25+ public int [ ] BaseVital = new int [ Enum . GetValues < Vital > ( ) . Length ] ;
2626
2727 [ NotMapped ]
2828 public Dictionary < int , long > ExperienceOverrides = new Dictionary < int , long > ( ) ;
@@ -43,13 +43,13 @@ public partial class ClassBase : DatabaseObject<ClassBase>, IFolderable
4343 public List < ClassSprite > Sprites = new List < ClassSprite > ( ) ;
4444
4545 [ NotMapped ]
46- public int [ ] StatIncrease = new int [ ( int ) Stat . StatCount ] ;
46+ public int [ ] StatIncrease = new int [ Enum . GetValues < Stat > ( ) . Length ] ;
4747
4848 [ NotMapped ]
49- public int [ ] VitalIncrease = new int [ ( int ) Vital . VitalCount ] ;
49+ public int [ ] VitalIncrease = new int [ Enum . GetValues < Vital > ( ) . Length ] ;
5050
5151 [ NotMapped ]
52- public int [ ] VitalRegen = new int [ ( int ) Vital . VitalCount ] ;
52+ public int [ ] VitalRegen = new int [ Enum . GetValues < Vital > ( ) . Length ] ;
5353
5454 [ JsonConstructor ]
5555 public ClassBase ( Guid id ) : base ( id )
@@ -162,17 +162,17 @@ public MapBase SpawnMap
162162 [ JsonIgnore ]
163163 public string JsonBaseStats
164164 {
165- get => DatabaseUtils . SaveIntArray ( BaseStat , ( int ) Stat . StatCount ) ;
166- set => BaseStat = DatabaseUtils . LoadIntArray ( value , ( int ) Stat . StatCount ) ;
165+ get => DatabaseUtils . SaveIntArray ( BaseStat , Enum . GetValues < Stat > ( ) . Length ) ;
166+ set => BaseStat = DatabaseUtils . LoadIntArray ( value , Enum . GetValues < Stat > ( ) . Length ) ;
167167 }
168168
169169 //Base Vitals
170170 [ Column ( "BaseVitals" ) ]
171171 [ JsonIgnore ]
172172 public string JsonBaseVitals
173173 {
174- get => DatabaseUtils . SaveIntArray ( BaseVital , ( int ) Vital . VitalCount ) ;
175- set => BaseVital = DatabaseUtils . LoadIntArray ( value , ( int ) Vital . VitalCount ) ;
174+ get => DatabaseUtils . SaveIntArray ( BaseVital , Enum . GetValues < Vital > ( ) . Length ) ;
175+ set => BaseVital = DatabaseUtils . LoadIntArray ( value , Enum . GetValues < Vital > ( ) . Length ) ;
176176 }
177177
178178 //Starting Items
@@ -207,26 +207,26 @@ public string JsonSprites
207207 [ Column ( "StatIncreases" ) ]
208208 public string StatIncreaseJson
209209 {
210- get => DatabaseUtils . SaveIntArray ( StatIncrease , ( int ) Stat . StatCount ) ;
211- set => StatIncrease = DatabaseUtils . LoadIntArray ( value , ( int ) Stat . StatCount ) ;
210+ get => DatabaseUtils . SaveIntArray ( StatIncrease , Enum . GetValues < Stat > ( ) . Length ) ;
211+ set => StatIncrease = DatabaseUtils . LoadIntArray ( value , Enum . GetValues < Stat > ( ) . Length ) ;
212212 }
213213
214214 //Vital Increases (per level0
215215 [ JsonIgnore ]
216216 [ Column ( "VitalIncreases" ) ]
217217 public string VitalIncreaseJson
218218 {
219- get => DatabaseUtils . SaveIntArray ( VitalIncrease , ( int ) Vital . VitalCount ) ;
220- set => VitalIncrease = DatabaseUtils . LoadIntArray ( value , ( int ) Vital . VitalCount ) ;
219+ get => DatabaseUtils . SaveIntArray ( VitalIncrease , Enum . GetValues < Vital > ( ) . Length ) ;
220+ set => VitalIncrease = DatabaseUtils . LoadIntArray ( value , Enum . GetValues < Vital > ( ) . Length ) ;
221221 }
222222
223223 //Vital Regen %
224224 [ JsonIgnore ]
225225 [ Column ( "VitalRegen" ) ]
226226 public string RegenJson
227227 {
228- get => DatabaseUtils . SaveIntArray ( VitalRegen , ( int ) Vital . VitalCount ) ;
229- set => VitalRegen = DatabaseUtils . LoadIntArray ( value , ( int ) Vital . VitalCount ) ;
228+ get => DatabaseUtils . SaveIntArray ( VitalRegen , Enum . GetValues < Vital > ( ) . Length ) ;
229+ set => VitalRegen = DatabaseUtils . LoadIntArray ( value , Enum . GetValues < Vital > ( ) . Length ) ;
230230 }
231231
232232 [ JsonIgnore ]
0 commit comments