color = $options['color']; $this->shape = $options['shape']; $this->plus = $options['plus']; $this->minus = $options['minus']; if (isset($options['id'])) { $this->id = $options['id']; } if (isset($options['is_shadow'])) { $this->is_shadow = $options['is_shadow']; } if (isset($options['shape2'])) { $this->shape2 = $options['shape2']; } } public function getWorth() { if ($this->is_shadow) { if (isset($this->color2)) { return 1; } return 0; } if (isset($this->color2)) { if ($this->plus > $this->minus) { return ceil($this->plus / 2); } return ceil($this->minus / 2); } return ceil(($this->plus + $this->minus) / 2); } public function getCost() { return floor($this->getWorth() / 2); } }