Code Monkey home page Code Monkey logo

univ-mmorpg's People

Contributors

drattak avatar palra avatar

Watchers

 avatar  avatar  avatar

univ-mmorpg's Issues

MoveAction : when to check if the character can move ?

For the moment, moving a character of one case on the map costs 1 action point. When do we check that the character has enough AP to move ? In the MoveCommand, or in the MoveAction ?
It seems more logical to do it in the MoveCommand, as the user can immediately know that he can't move anymore, but in that case, we have to pre-calculate the path that the character will take, meaning a new public method in World, and we still can't predict the fact that a player (that theorically can be collidable, but not always, it depends if he has redefined the isCollidable method) can cross the pre-calculated path, so the promise we did to the player that we could move him is broken.

Entity#getDisplay() : ANSIChar, what about other rendering methods

Entity#getDisplay returns an ANSIChar, meaning that to be able to be registered in the world, the entity must have implemented the way he has to be displayed on a terminal. If we want to render it with JFrame, this method becomes unusable. We have to move out the display strategy of the entity interface, so implementing classes, like Character, can be used in any graphical context. But where do we move it ? How do we finally implement different rendering strategies ?

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

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)

  • has(Item) -> has(Object)
  • remove(Item) -> remove(Object)

Rework copy constructors

For the moment, we don't clone the attributes of the class we clone. Should we do this ?
We will, then, have to implement the Cloneable interface, in order to have a polymophic clonable behavior.

How to specify the cure

How do we specify the cure we want to use ?
Now, we type the ID, but that's not user-friendly

Move FightEvent to event.action package

You should refactor class fr.univdevs.mmorpg.engine.event.FightEvent.FightEvent to fr.univdevs.mmorpg.engine.event.action.FightEvent. Not only FightEventis an invalid package name (it should be in lowercase), but it doesn't respect the event package naming convention set at #5.

Why removing the name attribute ?

In Protection.java :

    /**
     * Protection constructor
     * A protection is something the character carries to improve his defence
     *
     * @param protectionName       the name //TODO remove the name var
     * @param protectionCategory   the Category of the item //TODO remove from constructor, here category is Protection
     * @param protectionCost       the cost
     * @param protectionWeight     the Weight, is added to character's weight
     * @param protectionRobustness is equivalent to efficiency of the protection
     */

Why do you want to remove the protectionName parameter ?
And you don't have to remove protectionCategory, as it will be used by the children of this class.

Code cleanup

Before the deadline, we need to clean the code and respect the same code style :

  • Use this when accessing attributes inside a class
  • Use iterators when browsing a Collection (List, Map ...)
  • Use explicit loop conditions instead of returning inside of them : while(it.hasNext() && !hasFound) for example

Two ActionEvents

There's two ActionEvent classes in code, different packages, logger and game, which one do we keep ?

Move events from inner classes to their own package

We should stop put events in inner classes, for more readability. Also, it is more easier for a future developer to find the events classes in a dedicated package than searching on a class. Inner classes should be used if we really need to access inner attributes of the parent class, but that's not the case, as we pass them in argument.

My proposal is to create a package event in our working package (for example : fr.univdevs.mmorpg.engine.event) and put subpackages for each topic (fr.univdevs.mmorpg.engine.event.action)

Let logger in engine

The package logger should not be a part of the engine, just a dependency of it.
Move the logger package to fr.univdevs.logger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.