sample library
The roster this repository's own game ships with.
Not part of the engine's surface. flutter3d_game.dart does not export
this library, so a game depending on the package gets none of it unless it
asks — import 'package:flutter3d_game/sample.dart'; — and a second game
that wants its own monsters simply does not.
It stays inside the package rather than moving to apps/flutter3d_demo_dungeon for one
reason: the tests. Two hundred of them are written against these numbers,
and a roster is exactly what a test of an arsenal, a monster system or a
level validator needs to have lying about. Moving the data would have
churned seventy-odd references for no behavioural change and left the tests
inventing a fresh roster each time.
What matters is that nothing in lib/src/ reads any of it. The seam is the
deliverable; where the sample content sits is bookkeeping.
Classes
- Monsters
- The roster.
- SampleEntities
- What this game's own entity types are called in a document.
- Staged
- A level, spawned, with somebody standing in it ready to be stepped.
- Weapons
- The weapons this game ships with.
Properties
- sampleGifts → GiftRegistry
-
What a pickup in this game's levels may give.
final
Functions
-
agentStartingInventory(
) → Inventory - Everything an agent's own run starts holding — every weapon owned rather than sampleArsenal's two, so a blind policy can find out what each one does rather than being stuck finding pickups first.
-
sampleArsenal(
{int startingSlot = 0}) → Arsenal - The loadout this game's player starts with.
-
sampleLightKinds(
) → List< EntityKind> - The three lights this game's levels use.
-
sampleRegistry(
{bool monsters = true, Iterable< EntityKind> extra = const <EntityKind>[]}) → EntityRegistry - Everything above, assembled the way this game's levels expect.
-
sampleRules(
) → List< LevelRule> - What this game asks of a level as a whole.
-
stage(
Level level, CollisionWorld world, {required InputState input}) → Staged - Turns a level document into a run, given a world it has already been added to.