'average_lap' => array('fastest average lap', 'ByAverageLap', 1 << 5)
);
+ private static $COLOURS = array('#808080', '#000000');
+
+ function Colours() {
+ return self::$COLOURS;
+ }
+
function Prizes() {
return self::$PRIZES;
}
return $ret;
}
+ function getColours($strict = false) {
+ $colour1 = $this->getColour1();
+ $colour2 = $this->getColour2();
+ if ($strict && (! $colour1 || ! $colour2)) return null;
+ if (! $colour1) $colour1 = self::Colours()[0];
+ if (! $colour2) $colour2 = self::Colours()[1];
+ return array($colour1, $colour2);
+ }
+
+ function getFlag() {
+ $colours = $this->getColours(true);
+ if (! $colours) return '';
+ $style = "background-image: linear-gradient(-45deg, $colours[0] 0%, $colours[0] 50%, $colours[1] 50%, $colours[1] 100%);";
+ return " <span style=\"$style\"> </span>";
+ }
+
+ function getLink() {
+ return parent::getLink() . $this->getFlag();
+ }
+
}
<column name="name" type="varchar" size="64" required="true"/>
<column name="allotted_time" type="integer" required="false"/>
<column name="prizes" type="integer" required="false"/>
+ <column name="colour1" type="char" size="7" required="false"/>
+ <column name="colour2" type="char" size="7" required="false"/>
<unique name="name">
<unique-column name="name"/>
</unique>