package net.zomis.spring.games.generic.v2;

import net.zomis.spring.games.generic.PlayerInGame;

public interface GameHelper2<G> {

    /**
     * Validate game configuration and return whether or not it's allowed.
     *
     * @param gameConfiguration Game configuration object
     * @return A LobbyGame if success, otherwise anything else.
     */
    // TODO: Should this maybe throw an Exception? Or return ActionResult?
    LobbyGame<G> createGame(Object gameConfiguration);
    ActionResult playerJoin(LobbyGame<G> game, Object playerConfiguration);
    G startGame(LobbyGame<G> game);
    ActionResult performAction(RunningGame<G> game, PlayerInGame player, String actionType, Object actionData);
    Object gameSummary(RunningGame<G> game);
    Object gameDetails(RunningGame<G> game, PlayerInGame fromWhosPerspective);

}

@@ -546,24 +546,343 @@
 figuration);
+%0A%0A    /**%0A     * Validate Lobby game (number of players specifically) and return created game%0A     *%0A     * @param game LobbyGame that wants to be started%0A     * @return Game that was created, or null if game was not allowed to be started%0A     */%0A    // TODO: Use Either%3CG, String%3E or something to return failure status
 %0A    G start

Add documentation to GameHelper2