22declare(strict_types=1);
29use
function array_keys;
37 private int $railShape = BlockLegacyMetadata::RAIL_STRAIGHT_NORTH_SOUTH;
40 $w->straightOnlyRailShape($this->railShape);
45 if($railShape ===
null){
46 throw new \InvalidArgumentException(
"No rail shape matches these connections");
48 $this->railShape = $railShape;
55 public function getShape() : int{ return $this->railShape; }
60 throw new \InvalidArgumentException(
"Invalid rail shape, must be one of " . implode(
", ", array_keys(RailConnectionInfo::CONNECTIONS)));
62 $this->railShape = $shape;
setShapeFromConnections(array $connections)
describeBlockOnlyState(RuntimeDataDescriber $w)
getCurrentShapeConnections()