public function __construct(Statistic $statistic, array $properties) { parent::__construct($statistic->grimoire, $properties); $this->statistic = $statistic; $this->inProgress = $statistic->value >= $this->offset && $statistic->value < $this->threshold; $this->completed = $statistic->value >= $this->threshold; }
public function __construct(Page $page, array $properties) { parent::__construct($page->grimoire, $properties); $this->active = false; $this->score = 0; $this->page = $page; $this->statisticCollection = new StatisticCollection($this, $this->definition->statisticCollection); if ($this->status) { $this->active = true; $this->score = $this->status->score; } }
public function __construct(Card $card, array $properties) { parent::__construct($card->grimoire, $properties); $this->card = $card; $this->score = 0; $this->value = array_get($this->status, 'value'); $this->displayValue = array_get($this->status, 'displayValue'); $this->rankCollection = new RankCollection($this, array_get($properties, 'rankCollection')); foreach ($this->rankCollection as $rank) { if ($rank->completed) { $this->score += $rank->points; } } }
public function __construct(Grimoire $grimoire, array $properties) { parent::__construct($grimoire, $properties); $this->pageCollection = new PageCollection($this, $properties['pageCollection']); }
public function __construct(Theme $theme, array $properties) { parent::__construct($theme->grimoire, $properties); $this->theme = $theme; $this->cardBriefs = new CardCollection($this, $properties['cardBriefs']); }