Brief code browsing:
AdventureResult.HP and AdventureResult.MP have their values in the "count" field of an AdventureResult. So does AdventureResult.MEAT.
"count" is an int. An Adventure result also includes a priority (int), id (int), and name (String). Making count into a long will not double the size of an AdventureResult.
KoLCharacter has Meat, HP, and MP variables as ints and the methods to return them (getMaximumHP(), etc) return ints.
Numeric Modifiers are doubles. IEEE doubles have 53 bits of precision, which is fewer than 64 for a long - but more than 32 for an int.
ASH ints are Java longs. ASH floats are Java doubles. Runtime functions that return Meat, HP, MP, etc. call KoLCharacter methods and pass the returned value ro the Value(long) constructor to make into an ASH value. Currently, that just coerces the int to a long. If the KoLCharacter methods return longs, no additional memory will be used.
Conclusions:
- changing AdventureResult.count from an int to a long will change it from {int, int, int, String} to {int, int, long, String}. Which is to say, it'll add about an int to each one. I expect there are 10s of thousands of AdventureResults
- parsing and printing Meat/HP/MP/... will need to use Long methods rather than Integer methods
- methods that manipulate Meat/HP/MP/... (including using modifiers) will need to calculate using longs rather than ints
- (when using numeric modifiers, I would expect "loss of precision" warnings when coercing longs to doubles. I seriously doubt that Meat/HP/MP/... will really consume more than 53 bits, so I don't think there will be real overflow)
- ASH should require no changes since its ints are already longs.
So, yeah - there will be lots of places to change, and there will be a (somewhat) increased memory footprint, but it doesn't look that difficult or impactful.
AdventureResult.HP and AdventureResult.MP have their values in the "count" field of an AdventureResult. So does AdventureResult.MEAT.
"count" is an int. An Adventure result also includes a priority (int), id (int), and name (String). Making count into a long will not double the size of an AdventureResult.
KoLCharacter has Meat, HP, and MP variables as ints and the methods to return them (getMaximumHP(), etc) return ints.
Numeric Modifiers are doubles. IEEE doubles have 53 bits of precision, which is fewer than 64 for a long - but more than 32 for an int.
ASH ints are Java longs. ASH floats are Java doubles. Runtime functions that return Meat, HP, MP, etc. call KoLCharacter methods and pass the returned value ro the Value(long) constructor to make into an ASH value. Currently, that just coerces the int to a long. If the KoLCharacter methods return longs, no additional memory will be used.
Conclusions:
- changing AdventureResult.count from an int to a long will change it from {int, int, int, String} to {int, int, long, String}. Which is to say, it'll add about an int to each one. I expect there are 10s of thousands of AdventureResults
- parsing and printing Meat/HP/MP/... will need to use Long methods rather than Integer methods
- methods that manipulate Meat/HP/MP/... (including using modifiers) will need to calculate using longs rather than ints
- (when using numeric modifiers, I would expect "loss of precision" warnings when coercing longs to doubles. I seriously doubt that Meat/HP/MP/... will really consume more than 53 bits, so I don't think there will be real overflow)
- ASH should require no changes since its ints are already longs.
So, yeah - there will be lots of places to change, and there will be a (somewhat) increased memory footprint, but it doesn't look that difficult or impactful.