First off, if the question is worded wrong. Let me know, I wasn't sure how to word this question. ^^'
Ok, right now, I am working on a plugin API so people can change the programs behavior without having to modify the source, and users who can not program, but still want to modify it, can download other plugins people have made already. And right now, I am currently working on the Event System, where if a event is fired, the plugin can detect that a react to it. And I want the user to be able to put this code:
handleEvent(Event e) {}
And then use:
if(e instanceof <EVENTTYPE>) {
<EVENTTYPE> e2 = (<EVENTTYPE>) e;
// Do code here that could not be normally accessible without casting
}
But I have no idea how to do this, so I have no code to show. But, if you want the code I do have which works fine (Except for this, which I said I have no idea how to do) I can give it to you.
Aucun commentaire:
Enregistrer un commentaire