maxLayer property

int get maxLayer

The highest layer with a direction, or -1 without any.

Implementation

int get maxLayer => directions.keys.fold(-1, math.max);