Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Suggestion Replace RS3Event and OSRSEvent enums with RSEvents class

Engineer
Joined
Jul 28, 2013
Messages
2,776
The OSRSEvent and RS3Event enums are the two most branched parts of our API and I really don't like that. I want to consolidate the OSRSEvent and RS3Event enums into a single RSEvents class. The downside to this is it would no longer be an enum, which means that getting instances of RSEvent to disable/enable would require you to pass in the event name. I can make it easier for you to get the event name by providing a mapping in the javadocs.

Your code would probably change from
Code:
if(Environment.isRS3()){
RS3Event.LOBBY_HANDLER.disable();
}else{
OSRSEvent.LOBBY_HANDLER.disable();
}
To a single statement of
Code:
RSEvents.get("Lobby Handler").disable();

Any thoughts or suggestions on it?
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
The biggest problem that I could think of is that instead of having absolute enum values, you'd have to figure out the string for the event.
you could have an enum thats just a list of the events and we just parse that?
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
you could have an enum thats just a list of the events and we just parse that?
That's not doable though because OSRS and RS3 have very different events. If it was possible, I would have just done that from the beginning lol
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
That's not doable though because OSRS and RS3 have very different events. If it was possible, I would have just done that from the beginning lol
Well the only difference would be we'd be putting the enum value instead of a string. The enum would only be there to store the strings that we wouldn't otherwise know.
 
Top