zaterdag 5 februari 2011

Setting up the ladder table

So... Ladder... What do we need as info. This is a part of information I have been strugling with for quite a few days

now. Since basically it comes to this:

The results of matches defines the way the ladder changes. The ladder itself is pretty much "stupid" as information

wise. Since the only thing we really need is:

- Game
- Position
- Team
- Team Streak (how many wins in a row)
- Team Wins
- Team Losses
- Status (defending, attacking, protection,vulnerable)

This could be just be defined inside a single table with the fields as described. However, here comes the tricky part.

- Position is defined by the wins/losses and who got challenged from the matches
- Teamstreak is defined by the wins of the latest matches of the team
- Team wins gets defined by the wins of the matches
- Team losses gets defined by the losses of the matches
- Status gets defined by the last pending match AND the previous match

So at some point it is fair to say that the ladder gets updated on different points:
- When a match gets accepted (status change)
- When a match gets declined by both teams (status change)
- When a match is finished (Team Streak/ Wins / Losses updates / Position)

This above section needs to be done through one function (it needs to be centralized), since in that way I am able to rebuild the complete ladder when needed

Geen opmerkingen:

Een reactie posten