palra / univ-mmorpg

0 stars 0 forks source link

Addd apply method to Item #24

Closed palra closed 9 years ago

palra commented 9 years ago

For the moment, apply method is defined only in Cure : https://github.com/palra/univ-mmorpg/blob/feature/serialization/src/main/java/fr/univdevs/mmorpg/engine/character/item/Cure.java#L65-L72 Why wouldn't we move this method to item, allowing every item to apply a given effect on a given Character ? This method should not be abstract, as onRegister and onUnregister, allowing the possibility to an child item to not redefine this method, if it doesn't use it.

drattak commented 9 years ago

What's the difference between apply and onRegister?

palra commented 9 years ago

onRegisters is executed when the item is added to the inventory of a character, apply is called when we want to use the item, for a cure for example : we can't make use of a cure when grabing it on the map, we have to delay the action, with a CureAction

drattak commented 9 years ago

But apply, for a cure, is the equivalent to CureAction

drattak commented 9 years ago

and it will force us to create ApplyCommand, applyAction etc...

palra commented 9 years ago

In fact, forgot what I said