I think XML is the best way to store the fixtures. That way anyone can customize their own feature and we can (way, way in the future) work on a graphical-based fixture editor. For now, though, we will provide a set of 5-6 pre-coded fixture XML files that can be used by the users of the application. People can share their own fixtures, if they want to, and hence make completely custom tournaments. Sort of like the feature you would like in every cricket-based game but has never been available.
Keep in mind that the XML is being developed with an idea of being re-used. So, any specific information should not be included here. For example, instead of creating an "Ashes" fixture, you would create a fixture that represented a 5-Test match series. When using the fixture, you would specify attributes such as name, etc. So as I see it, here are the main elements we can have:
tournament - the parent element
match - represents a match
pointstable - represents information about how the points table must be calculated (not the table itself)
More advanced/optional features could include
rounds/round - to show that it is a multi-round tournament such as a World Cup
pools/pool - to show that there are multiple pools such as an Asia Cup or the PCPL (pool == league
)
Using these four elements, I have built a simple example of what I think could be the fixture XML for a Triangular series:
HTML:
<tournament id="Triangular Series" numberOfTeams="3" type="od" league="intl">
<pointstable pointsPerWin="2" pointsPerLoss="0" pointsPerTie="1" pointsPerAbandoned="1" sortOrder="PTS,HEADTOHEAD,NRR,W">
<rounds>
<round id="r1">
<match id="1" team1="1" team2="2" />
<match id="2" team1="1" team2="3" />
<match id="3" team1="2" team2="3" />
</round>
<round id="r2">
<match id="1" team1="1" team2="2" />
<match id="2" team1="1" team2="3" />
<match id="3" team1="2" team2="3" />
</round>
<round id="finals">
<match id="1" team1="POINTSTABLE[0]" team2="POINTSTABLE[1]" />
</round>
</rounds>
</tournament>
A few notes here. The round id and match id would be used to calculate a unique name for each match in that tournament. For example, "r1.3" would refer to the game 3 in round 1 and "r2.2" would refer to game 2 in round 2. You could use these values in the team1, team2 fields... for example to specify semifinal spots or something like that. POINTSTABLE would be a reserved name (all reserved names would be in caps) that can be used to access the closest points table. By closest, I mean that if you had separate pools, they would use a points table defined in the pool. So, a simplified quadrangular would look like this.
HTML:
<tournament id="Quadrangular Series" numberOfTeams="6" type="od" league="intl">
<rounds>
<round id="robin">
<pools>
<pool id="groupa">
<pointstable pointsPerWin="2" pointsPerLoss="0" pointsPerTie="1" pointsPerAbandoned="1" sortOrder="PTS,HEADTOHEAD,NRR,W">
<match id="1" team1="1" team2="2" />
<match id="2" team1="1" team2="3" />
<match id="3" team1="2" team2="3" />
</pool>
<pool id="groupb">
<pointstable pointsPerWin="2" pointsPerLoss="0" pointsPerTie="1" pointsPerAbandoned="1" sortOrder="PTS,HEADTOHEAD,NRR,W">
<match id="1" team1="4" team2="5" />
<match id="2" team1="4" team2="6" />
<match id="3" team1="5" team2="6" />
</pool>
<pools>
</round>
<round id="semis">
<match id="1" team1="groupa.POINTSTABLE[0]" team2="groupb.POINTSTABLE[1]" />
<match id="2" team1="groupb.POINTSTABLE[0]" team2="groupa.POINTSTABLE[1]" />
</round>
<round id="finals">
<match id="1" team1="semis.1" team2="semis.2" />
</round>
</rounds>
</tournament>
The round.id.n refers to the winner of that specific game. Questions/comments welcome. This is going to be a non-trivial component with plenty of nifty programming! Luckily I have done something very similar before, albeit about a year and a half back. That was in Java, though.
sohummisra added 2 Minutes and 31 Seconds later...
This was in the other thread. Will we create a user interface for end-users to create/edit fixtures or will they edit the actual XML files themselves, assuming that's what is meant by the above quote?
I think for starters, we should just give them 4-5 XML files (including customized ones for PCCL and PCPL). The guide would basically be a more intuitive and better explained version of what I posted above. Giving them a GUI will be something that depends on how tired we are of the project and how far-reaching it may become.
The important thing to make sure is that everything is editable in the UI. So that if something wasn't done correctly in the XML, the users can manually modify it. But that is a UI issue IIRC.