/** * @param Hexa $hexa1 * @param Hexa $hexa2 * @return Frontiere */ public function createIfNotExists(Hexa $hexa1, Hexa $hexa2) { $frontiere = $this->getByIndex(Partie::getIndexCouple($hexa1, $hexa2)); if (is_null($frontiere)) { $frontiere = new Frontiere($hexa1, $hexa2); $this->append($frontiere); } return $frontiere; }
/** * @return string */ public function getIndex() { return Partie::getIndexCouple($this->getHexa1(), $this->getHexa2()); }