1 Reply Latest reply: May 18, 2010 6:38 AM by 843853 RSS

    Dice game model


      For a design pattern class I have a little application to make using design patterns.

      I have developped the model of this application, but honestly I don't know if it's correct. Can anyone give me some insight on it.

      The question is:

      􀂄 A Dice Game
      􀂄 A Player rolls 10x 2 dices
      􀂄 If result = 7, score=score + 10 points
      􀂄 At the end, score of the player is registred in a database.

      I have come up with the following class diagram:


      Basically the game starts, the game object uses 2 dices and a player object. each time the rollDices() method is called, the two dices are rolled and the score is incremented if necessary. At the end of the game the score and the player name are persisted in tthe database.

      Edited by: Exhortae on May 15, 2010 4:04 PM