StrategyVisuals class final

Constructors

StrategyVisuals({required StrategySimulation simulation, required GraphicsDevice device, int capacity = 4096, int? viewer, RenderMaterial? ground, RenderMaterial? units, RenderMaterial? buildings, RenderMaterial? unseen, RenderMaterial? remembered, UnitSize unitSize = const UnitSize(), DeviceMesh? unitMesh, DeviceMesh? buildingMesh, Vector3? buildingMeshSize, List<UnitLook> looks = const <UnitLook>[], List<RenderMaterial>? buildingSides, bool buildingStandsTall = false, MeshLook? resource, List<PropBatch> props = const <PropBatch>[], double? waterLevel, RenderMaterial? water, double groundMetersPerTexture = 8.0})
Builds the ground and the batch the crowd is drawn in.

Properties

buildings → Iterable<MeshNode>
The building nodes drawn so far, in the order they were drawn.
no setter
crowd → InstancedMeshNode
The batch the crowd is drawn in, for a game that wants to tint or hide it and for a test that wants to read a transform back.
no setter
hashCode → int
The hash code for this object.
no setterinherited
propBatchCount → int
How many batches of props there are: one per PropBatch given.
no setter
remembered → InstancedMeshNode?
The tiles over ground viewer has seen and cannot see now.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
simulation → StrategySimulation
What is drawn.
final
unitSize → UnitSize
How big a unit is drawn.
final
unseen → InstancedMeshNode?
The tiles over ground viewer has never seen, or null for a spectator.
no setter
viewer → int?
Whose view this is, or null for a view belonging to nobody.
final
water → MeshNode?
The sheet of water, or null for a map with no waterLevel or with no ground below it.
no setter
waterLevel → double?
How high the water stands, or null for a dry map. In metres of world height.
final

Methods

addTo(Scene scene) → void
Puts the ground, the crowd and the fog into scene, and keeps it for the buildings that arrive later.
buildingAt(int index) → MeshNode?
The node drawn for simulation.buildings[index], or null while the viewer has not found it.
dressProp(int batch, int placement, {required LinearColor color, Matrix4? transform}) → bool
Draws prop placement of batch batch tinted color, linear, and, when transform is given, placed by it rather than where it was planted; false, and nothing done, while the viewer has not found it yet.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
propPlacementsOf(int batch) → List<Matrix4>
Where each prop of batch batch was planted, in the order given.
sync() → void
Brings the picture up to date with the simulation.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited