gluxon / phpwolf

The popular Werewolf game (variant of Mafia) powered by a PHP IRC bot
GNU General Public License v3.0
12 stars 7 forks source link

Simplify player and role arrays and make access to this data easier #59

Open ceradon opened 11 years ago

ceradon commented 11 years ago

Phpwolf arrays are, in its current state, all over the place, so I propose that the arrays be set up into two central array: $players and $roles. $players would contain a nested array, which contains a users' id based on the order that the users joined that game (1, 2, etc...) and the users' roles (also an array) which contains all the roles of that specific user. $roles are all the users based on their roles. A structured example of this is locate here at a GitHub Gist.

gluxon commented 11 years ago

Your proposal for this duplicates data. Why have user roles inside $players and $roles?

gluxon commented 11 years ago

I also have to disagree with "phpwolf arrays are all over the place". There is a fair level of organization. Are there things in particular that annoy you with the current setup?