[ Vector3::SIDE_SOUTH, Vector3::SIDE_EAST ], self::CURVE_SOUTHWEST => [ Vector3::SIDE_SOUTH, Vector3::SIDE_WEST ], self::CURVE_NORTHWEST => [ Vector3::SIDE_NORTH, Vector3::SIDE_WEST ], self::CURVE_NORTHEAST => [ Vector3::SIDE_NORTH, Vector3::SIDE_EAST ] ]; protected $id = self::RAIL; public function getName() : string{ return "Rail"; } protected function getMetaForState(array $connections) : int{ try{ return self::searchState($connections, self::CURVE_CONNECTIONS); }catch(\InvalidArgumentException $e){ return parent::getMetaForState($connections); } } protected function getConnectionsForState() : array{ return self::CURVE_CONNECTIONS[$this->meta] ?? self::CONNECTIONS[$this->meta]; } protected function getPossibleConnectionDirectionsOneConstraint(int $constraint) : array{ static $horizontal = [ Vector3::SIDE_NORTH, Vector3::SIDE_SOUTH, Vector3::SIDE_WEST, Vector3::SIDE_EAST ]; $possible = parent::getPossibleConnectionDirectionsOneConstraint($constraint); if(($constraint & self::FLAG_ASCEND) === 0){ foreach($horizontal as $d){ if($constraint !== $d){ $possible[$d] = true; } } } return $possible; } }