kellyelton/OCTGN — Issue #119: Add an empty dictionary for each player in the global player array
Author: db0
Created: 2012-02-09 07:39:19+00:00
State: open

[Repost from the old bugtracker](https://octgn.16bugs.com/projects/3602/bugs/189587)

I think you guys are working on global variables in some form, but I thought I'd repost this anyway.

Now that we have a nice global array (a list?) for storing the player names, I’d like to expand it a bit to give us a place to store some variables to be polled by local scripts. I’d like this array to be expanded to be a nested array (or a tuple?) which includes an empty dictionary per player, which a local script can populate to store values that the game needs to remember for each player. This would be extremely useful for comparisons and the like.

So if your current global array population looks like this

players = [player1, player2, player3]

I’d like to make it look like this

players = [[player1,{}], [player2,{}], [player3,{}]]

So then I can do something [like this](http://pastebin.ca/2054255)

In my case, I’d like to have a place to store poker hand ranks (eg a two pair is a 2, and is lower than a three of a kind which is a 4) and then announce the leader and do some actions according to that result.

At the moment I have hacked around this, by creating a new counter per player, but it’s not a elegant solution and it can only work with numerical comparisons.

So if such an implementation is possible, it would open up a lot more possibilities.