palra / univ-mmorpg

0 stars 0 forks source link

Change Inventory#has(Item) to Inventory#has(Object) #20

Closed palra closed 9 years ago

palra commented 9 years ago

https://github.com/palra/univ-mmorpg/blob/feature/serialization/src/main/java/fr/univdevs/mmorpg/engine/character/Inventory.java#L174-L182

In Java, HashMap<K,V>#containsValue takes an Object in parameter, even it its generic form, so we should follow the rules. See : http://docs.oracle.com/javase/7/docs/api/java/util/Map.html#containsValue(java.lang.Object)

We should also change the remove method so it takes an Object in parameter too, as HashMap<K,V>#remove(Object)

drattak commented 9 years ago

Why? It doesn't seem so important

Le dim. 14 juin 2015 19:07, Loïc Payol notifications@github.com a écrit :

https://github.com/palra/univ-mmorpg/blob/feature/serialization/src/main/java/fr/univdevs/mmorpg/engine/character/Inventory.java#L174-L182

In Java, HashMap<K,V>#containsValue takes an Object in parameter, even it its generic form, so we should follow the rules.

— Reply to this email directly or view it on GitHub https://github.com/palra/univ-mmorpg/issues/20.

palra commented 9 years ago

Just for compatibility with the Java standards, otherwise that's not so important