sampleRules function

List<LevelRule> sampleRules()

What this game asks of a level as a whole.

Two rules, and both are about this game rather than about the format: one place to start, and a way to finish. A game that ends by script rather than by walking into a door passes an empty list.

Implementation

List<LevelRule> sampleRules() => const <LevelRule>[
  ExactlyOne(
    EntityTypes.playerSpawn,
    because:
        'the player would start at the origin, which is usually '
        'inside the floor',
  ),
  AtLeastOne(EntityTypes.exit, because: 'the level cannot be finished'),
];