I am new to Android and Java development and am looking to implement a custom event, however having done lots of research and trying various different approaches i cannot seem to get it to work.
I am essentially trying to create a battle system, which i have implemented in .NET but cannot seem to get working in Java, it requires me to create events for things such as DealtDamage, DamageReceived, Died etc.
This will be inherteing information from the characters object which consits of thing such as hp, attack, defence etc.
Can someone please provide sample code how I can create these events and then action them in various classes.
e.g. Damage Dealt
user1 atk – user 2 def = totalatk
return totalatk
Thanks
If you are trying to generate callbacks from your class (raise events):
In the class which generates the callback:
In the consuming class:
(from memory, apologies for typos and syntax errors but you get the idea…I hope)
Good luck.