View Single Post
Old 08-10-2014, 06:00 PM   #31
Groundhog
Coordinator
 
Join Date: Dec 2003
Location: Sydney, Australia
I should also add that the actual player information is a dictionary within a dictionary that's within another dictionary... Hence the "kind of database" comment.

The top level of the dictionary is a value for '0' - home team, and '1' - road team. There is a variable that tracks whether the home or road team has possession - 0 or 1 - which is then used to automatically reference either the offense or defense roster and attributes when required.

So to use another example, when the high screen is called by the function, the values sent to the function will looked like:
Code:
rosterdictionary[pos][playerid]["offaware"], rosterdictionary[defteam][playerid]["defaware"]
'pos' is the variable that is either 0 or 1 for possession, and that will point the function to the desired offensive player. 'defteam' is the opposite value of 'pos', and thus points to the defensive roster.

Playerid is calculated using another dictionary which tracks the 5 players on the court for each team. It includes the positions on the court as the keys, and the the id # of the player in that position as the value. Substitutions are a long way out yet, but this is how they will work.
__________________
Politics, n. Strife of interests masquerading as a contest of principles.
--Ambrose Bierce
Groundhog is offline   Reply With Quote