mliebelt/pgn-parser

Correct time control to allow more than 1 period

Closed this issue · 1 comments

I have misread the specification about TimeControl which is not easy to read. Here are some examples ( taken from #13 )

  • German leagues (90 minutes with incr. 30 seconds, last period 30 minutes):
    • 40/5400+30:1800+30
    • or 40/4500:1800+30
    • I think the first one is the correct one (what if the increment is only valid for the sudden death phase??)
  • Blitz (3+2)
    • 180+2: Use seconds all the time.
  • German league (former time control) 2 hours / 40, 1 hour / 20, rest 30 minutes, no increment.
    • 40/7200:20/3600:1800
  • Blitz (5)
    • 300

So what I have not taken into consideration was, that each time period may have a different description. They are separated by ':'.

So the parsing rules should be changed. As a result, the TimeControl is then an array of periods, with each period being the TimeControl from before.

The one format (40/5400+30:1800+30) is not supported (yet), I will have to do some additional documentation in the spec. This combines movesInSeconds and increment in one period (which is not allowed due to the spec).