FilippoCarloni / the_42nd_sagrada

The 42nd Sagrada: a software engineering university project.
MIT License
0 stars 0 forks source link

ClothDiceBag #1

Closed ingconti closed 6 years ago

ingconti commented 6 years ago

should be Singleton?

pls explain if not, or adopt if is the case.

archettialberto commented 6 years ago

I thought about adopting a Singleton pattern for the dice bag implementation, but I did not for two reasons:

  1. the progressive identifier of the dice should not be the same for all games (could be a security/overflow issue)
  2. as the last deadline main explains, the dice bag must contain exactly 90 dice in every game, so it's not possible to share the dice bag between more games without affecting the bag implementation complexity
ingconti commented 6 years ago

interesting points, we will discuss in presence.(eve if security flaw is a bit odd :) ) I agree in multigame is we have multiple bags, but I suppose you will have MULTIPLE GAMES where each game has its own bag... so can be a singleton... inside game

ingconti commented 6 years ago

I saw you are 3 people, but I see on stats:

archettialberto 11 commits 2,234 ++ 167 --

2

FilippoCarloni 6 commits 611 ++ 343