Class SimWorld
- Namespace
- SurvivorsMaker.Simulation
- Assembly
- SurvivorsMaker.Simulation.dll
All state of one running wave. Systems read and write it; presentation only reads it. Lists keep a stable order: new items are appended, removal keeps the order of the rest.
public sealed class SimWorld
- Inheritance
-
SimWorld
- Inherited Members
Constructors
SimWorld()
public SimWorld()
Fields
ActualMovingTicks
public int ActualMovingTicks
Field Value
ActualStationaryTicks
public int ActualStationaryTicks
Field Value
Arena
public ArenaRect Arena
Field Value
ArenaDef
The arena definition, for CommonGroups.
public ArenaDef ArenaDef
Field Value
BehaviourSpawns
Spawns asked for by enemy attacks this tick; admitted after all enemies acted.
public readonly List<SpawnRequest> BehaviourSpawns
Field Value
Combat
Hit/damage rules shared by systems. Set by the tick loop at start.
public ICombat Combat
Field Value
CombatWallet
public StatWallet CombatWallet
Field Value
DeathSpawns
Spawns asked for by deaths this tick; admitted after dead enemies are removed.
public readonly List<SpawnRequest> DeathSpawns
Field Value
Difficulty
public int Difficulty
Field Value
Enemies
public readonly List<Enemy> Enemies
Field Value
EnemyProjectiles
public readonly List<Projectile> EnemyProjectiles
Field Value
Events
Events of the current tick only; cleared at the start of each tick.
public readonly List<SimEvent> Events
Field Value
FriendlyProjectiles
public readonly List<Projectile> FriendlyProjectiles
Field Value
HasExtendedTriggers
public bool HasExtendedTriggers
Field Value
HitHealCooldownTicks
public int HitHealCooldownTicks
Field Value
HitSource
The weapon definition behind the HitEnemy(SimWorld, Enemy, int, bool, int, Vec2, float) call in progress, or null. Set by the weapon system around each hit, so wrappers (e.g. balance meters) can attribute damage.
public WeaponDef HitSource
Field Value
HordesFired
Horde events of the wave that already fired (indexes into Wave.Hordes).
public readonly List<int> HordesFired
Field Value
MinimumGrowthExperience
public float MinimumGrowthExperience
Field Value
MovingTicks
public int MovingTicks
Field Value
OwnedEntityCounts
public readonly Dictionary<string, int> OwnedEntityCounts
Field Value
PickupRules
Replace through WaveSimulation's pickup-rules constructor overload.
public PickupRules PickupRules
Field Value
Pickups
public readonly List<Pickup> Pickups
Field Value
Player
The first (and today the only) player. Same object as Players[0].
public readonly PlayerState Player
Field Value
Players
Every player in the wave, Player first. Single-player games have one entry; systems that operate on additional players iterate this list instead of using Player.
public readonly List<PlayerState> Players
Field Value
PlaytestInvulnerable
Development-only damage bypass; false keeps the ordinary combat path.
public bool PlaytestInvulnerable
Field Value
Pools
Object reuse for projectiles, enemies and statuses. Set by the tick loop from Pools.
public ISimPools Pools
Field Value
Progress
public readonly WaveProgress Progress
Field Value
Random
public SimRandom Random
Field Value
Schedule
Active spawn groups, filled by Begin(SimWorld) in authoring order.
public readonly List<ScheduledGroup> Schedule
Field Value
Settings
public SimSettings Settings
Field Value
Spatial
Enemy lookups by area. Set by the tick loop from Spatial; rebuilt after enemies move and spawns are admitted.
public ISpatialIndex Spatial
Field Value
StationaryTicks
public int StationaryTicks
Field Value
Stats
public StatBuild Stats
Field Value
Systems
The systems running this world, so one system can call another (e.g. spawning → InitEnemy).
public SimSystems Systems
Field Value
Telegraphs
public readonly List<Telegraph> Telegraphs
Field Value
TempBuffs
public readonly List<TempBuff> TempBuffs
Field Value
TriggerHandlers
Handlers for TriggerAction.Custom, from WaveRequest.TriggerHandlers (set at wave start).
public IReadOnlyDictionary<string, ITriggerHandler> TriggerHandlers
Field Value
Triggers
Triggers of this wave in WaveRequest order (filled by the trigger system's Begin).
public readonly List<TriggerState> Triggers
Field Value
Wave
public WaveDef Wave
Field Value
WaveNumber
public int WaveNumber
Field Value
WavesSinceFirst
public int WavesSinceFirst
Field Value
Weapons
public readonly List<WeaponState> Weapons
Field Value
Properties
Behaviours
Behaviour registries, from Behaviours.
public SimBehaviours Behaviours { get; }
Property Value
CurrencyIncome
public long CurrencyIncome { get; }
Property Value
Occupancy
Enemies + telegraphs, the count limited by MaxAlive.
public int Occupancy { get; }
Property Value
Tick
public int Tick { get; }
Property Value
Methods
CanSpawnForPlaytest(EnemyDef)
Validates the registered spawn behaviours before a playtest command mutates the world.
public bool CanSpawnForPlaytest(EnemyDef definition)
Parameters
definitionEnemyDef
Returns
Emit(SimEventKind, Vec2, int, int, float, int, bool)
public void Emit(SimEventKind kind, Vec2 position, int sourceId = 0, int targetId = 0, float amount = 0, int slot = -1, bool crit = false)
Parameters
EmitCustom(string, Vec2, float, int, int, int)
Emits a Custom event that views, sounds and modules can react to.
public void EmitCustom(string id, Vec2 position, float amount = 0, int sourceId = 0, int targetId = 0, int slot = -1)
Parameters
GrantLevelsForPlaytest(int)
Applies level health growth and emits the same LevelUp events, without advancing combat time.
public bool GrantLevelsForPlaytest(int levels)
Parameters
levelsint
Returns
NewId()
One id sequence for enemies, telegraphs, projectiles and pickups.
public int NewId()
Returns
NewSpawnOrder()
public int NewSpawnOrder()
Returns
SetOwnedEntityCount(string, int)
Updates one named owned-entity source count and signals source invalidation.
public void SetOwnedEntityCount(string kind, int count)
Parameters
SignalStatSourcesChanged()
Invalidates cached external stat-source evaluation after gameplay source state changes.
public void SignalStatSourcesChanged()
SpawnForPlaytest(EnemyDef, int)
Spawns an evenly spaced ring at the configured safe distance, bypassing capacity/telegraphs.
public bool SpawnForPlaytest(EnemyDef definition, int count)
Parameters
Returns
SpawnPickup(string, Vec2, int)
Appends a registered pickup with a fresh world id. Invalid ids throw before mutation.
public Pickup SpawnPickup(string behaviourId, Vec2 position, int value = 0)
Parameters
Returns
Stat(string)
public int Stat(string id)
Parameters
idstring
Returns
TryCreditCurrency(int)
Credits the world currency wallet atomically; failure leaves wallet state unchanged.
public bool TryCreditCurrency(int amount)
Parameters
amountint
Returns
TryDebitCurrency(int)
Debits the world currency wallet atomically; failure leaves wallet state unchanged.
public bool TryDebitCurrency(int amount)
Parameters
amountint