Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The basic structure of your game engine uses the <a href="http://en.wikipedia.org/wiki/State_pattern" rel="noreferrer">State Pattern</a>. The items of your game box are <a href="http://en.wikipedia.org/wiki/Singleton_pattern" rel="noreferrer">singletons</a> of various classes. The structure of each state may use <a href="http://en.wikipedia.org/wiki/Strategy_pattern" rel="noreferrer">Strategy Pattern</a> or <a href="http://en.wikipedia.org/wiki/Template_method_pattern" rel="noreferrer">the Template Method</a>. </p> <p>A <a href="http://en.wikipedia.org/wiki/Factory_method_pattern" rel="noreferrer">Factory</a> is used to create the players which are inserted into a list of players, another singleton. The GUI will keep watch on the Game Engine by using the <a href="http://en.wikipedia.org/wiki/Observer_pattern" rel="noreferrer">Observer pattern</a> and interact with this by using one of several Command object created using the <a href="http://en.wikipedia.org/wiki/Command_pattern" rel="noreferrer">Command Pattern</a>. The use of Observer and Command can be used with in the context of a <a href="http://www.martinfowler.com/eaaDev/PassiveScreen.html" rel="noreferrer">Passive View</a> But just about any MVP/MVC pattern could be used depending on your preferences. When you save the game you need to grab a <a href="http://en.wikipedia.org/wiki/Memento_pattern" rel="noreferrer">memento</a> of it's current state</p> <p>I recommending looking over some of the patterns on this <a href="http://www.martinfowler.com/eaaDev/" rel="noreferrer">site</a> and see if any of them grab you as a starting point. Again the heart of your game board is going to be a state machine. Most games will represented by two states pre-game/setup and the actual game. But you can had more states if the game you are modelling has several distinct modes of play. States don't have to be sequential for example the wargame Axis &amp; Battles has a battle board the players can use to resolve battles. So there are three states pre-game, main board, battle board with the game continually switching between the main board and battle board. Of course the turn sequence can also be represented by a state machine.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload