Closed ParkerFisher closed 1 year ago
Ok no problem, based on earlier msgs i had figured you would want them as separate as possible. can adjust accordingly
condensed everything into IEGO and IEGOHelper.cs. Go.cs uses an instance of IEGOhelper now, where relavent offsets are changed to JP offsets, only for that instance.
Hi.
Almost done, just avoid including code that allows changing IEGOHelper class variables in IEGO.cs so remove UseJPOffsets from IEGO.cs and create IEGOHelper constructor with bool variable, when the boolean is true, it's change the offset, and you should add boolean IsJP on IEGOHelper.cs. Also I have a question what is the purpose of sealed class?
public boolean isJP;
public IEGOHelper(bool isJP)
{
IsJP = isJP;
if (IsJP)
{
TeamNameOffset = 0x5C;
MoneyOffset = 0x8D8C;
PlayerDataOffset = 0x3438;
PlayerIndexOffset = 0x8E78;
ItemBlockGroup1Offset = 0xA10;
ItemBlockGroup2Offset = 0x161C;
ItemBlockGroup3Offset = 0x2428;
}
}
yea sure i can do that.
sealed class blocks use of IEGOhelpers private constructor with any subclasses. It helps prevent a subclass accidentally accessing data in IEGOhelper not meant to be changed.
since i removed it being static, objects can access it so this is to keep everything clean
Example of what happens without sealed:
internal class Why_Sealed
{
private static int count = 0;
private static Why_Sealed _instance = null;
private Why_Sealed()
{
count++;
Console.WriteLine("Count value : " + count);
}
public static Why_Sealed Instance
{
_instnace = new Why_Sealed();
}
private class DerivedClass : Why_Seald
{
}
}
Public class Program
{
static void Main()
{
var why_Seald_Obj = Why_Seald.Instance;
var deriveObj = new Derived();
}
}
Output : Count Value : 1 Count Value : 2
I didn't know thank you
Now it's fine, thank you
Please make sure that IEGO.cs can be parameterized with an IEGOHelper EUR or IEGOHelper JP, because in the current state I can't accept your pull request, because for every modification I want to make in IEGO.cs I have to make them in IEGOJP.cs, which is a loss of productivity.