Add "No more jams" indication#287
Conversation
brian-brazil
left a comment
There was a problem hiding this comment.
I'll leave the review until the timeout stuff is in.
| REVIEWS_PER_PERIOD(new BooleanRule("Team.OfficialReviewsPer", "Are official reviews granted per period or per game?", true, "Period", "Game")), | ||
| NUMBER_RETAINS(new IntegerRule("Team.MaxRetains", "How many times per game or period a team can retain an official review", 1)), | ||
|
|
||
| MANDATORY_OVERTIME(new BooleanRule("Overtime.Mandatory", "Will a tied game always go to overtime?", true, "True", "False")), |
| protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { | ||
| if (prop == Value.UPCOMING_JAM && !(value instanceof Jam)) { | ||
| value = new JamImpl(this, getCurrentPeriod().getCurrentJam()); | ||
| } else if (prop == Value.NO_MORE_JAM) { |
There was a problem hiding this comment.
The logic isn't quite right here, if I stop on 30 it goes red rather than allowing another jam.
There was a problem hiding this comment.
There are exactly 30s between the moment when the display flips to 30 and the moment when the display flips to 0. So if you stop when the 30 is already showing, there are only 29.x seconds remaining and there should not be another Jam.
But I've changed the code to give you another Jam when you hit exactly 30.0s.
|
Can you rebase this off dev? |
When there won't be another regular jam in this period without intervention (TTO/OR), mark the headers of running clocks in red on the operator screen and display the lineup/timeout clock with a red background on the main view. Closes rollerderby#218
also remove unused rule
d27bf22 to
e3f41a3
Compare
|
Done. |
brian-brazil
left a comment
There was a problem hiding this comment.
The new logic should have a unittest, covering OTO+TO cases preferably too.
| if (WS.state[prefix + '.WalltimeEnd'] == 0 && WS.state[prefix + '.WalltimeStart'] > 0) { | ||
| row.find("td.PC").text("running"); | ||
| } else { | ||
| row.find("td.PC").text(_timeConversions.msToMinSec(v)); |
There was a problem hiding this comment.
This doesn't seem to be working, it's always empty.
There was a problem hiding this comment.
This is showing elapsed time, we probably want whatever the operator is seeing in terms of inversion.
There was a problem hiding this comment.
True. Changed. (Also unit tests in.)
| $("<a>").text("Duration").addClass("Title") | ||
| .appendTo(headers.find("td:eq(2)").addClass("Title")); | ||
| $("<a>").text("PC at end").addClass("Title") | ||
| .appendTo(headers.find("td:eq(3)").addClass("Title")); |
There was a problem hiding this comment.
prefer children to find when you can, it's faster.
There was a problem hiding this comment.
While I was at it I did some other straightforward optimizations as well, like using k.Period etc.
|
Hmm, points isn't showing on the Jams popup but I presume that's due to something else. |
|
Ah, damn, that was one |
|
Changing those is always fun ;) |
When there won't be another regular jam in this period without
intervention (TTO/OR), mark the headers of running clocks in red on the
operator screen and display the lineup/timeout clock with a red
background on the main view.
Closes #218
Includes #283 as I needed those stats to reliably detect if there has been a timeout that gives another jam.