Class WaveIdDefaults
Derives a wave's default Id from its owning Wave Set Id and play-order index, and tells apart a wave
whose Id was authored by hand from one that still carries the default this class produced. Fixes the
authoring defect where every wave defaulted to a plain "wave_00" regardless of its Wave Set: two
differently-named Wave Sets on the same stage would then resolve to the SAME UnityWaveConfigSO
asset in <StageFolder>/Waves/ and silently share wave data (Audit §3.2/§4).
Inherited Members
Namespace: Serenity.Wave.Editor.Builder
Assembly: Serenity.UnityWave.Editor.dll
Syntax
public static class WaveIdDefaults
Remarks
Pure string logic — no UnityEditor or asset access — so it is unit-testable on its own and reused
identically by CreateWaveWindow's "+ Wave" button, its preset appliers
(Serenity.Wave.Editor.Builder.WavePresetApplier), and its Wave Set Id re-derivation on edit.
Methods
Default(string, int)
The default Id for the wave at play-order index within
waveSetId — e.g. "WaveSet_SingleEscalating_wave_00". Sanitized the same way
every other creator's by-Id file name is (FileNameSafe(string, string)), so an
in-progress, not-yet-valid Wave Set Id never produces an unusable default.
Declaration
public static string Default(string waveSetId, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| string | waveSetId | |
| int | index |
Returns
| Type | Description |
|---|---|
| string |
IsDefaultFor(string, string, int)
True when candidateId is exactly the default Default(string, int) would
produce for waveSetId at index — how a caller tells a
still-default wave Id apart from one a user typed by hand.
Declaration
public static bool IsDefaultFor(string candidateId, string waveSetId, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| string | candidateId | |
| string | waveSetId | |
| int | index |
Returns
| Type | Description |
|---|---|
| bool |
Rederive<TRow>(IReadOnlyList<TRow>, string, string, Func<TRow, string>, Action<TRow, string>)
Re-derives the Id of every row in rows that still carries the default produced for
previousWaveSetId at its own play-order position, replacing it with the default for
newWaveSetId at that same position. A row whose Id does not match its previous
default — because a user typed it by hand — is left untouched.
Declaration
public static void Rederive<TRow>(IReadOnlyList<TRow> rows, string previousWaveSetId, string newWaveSetId, Func<TRow, string> getId, Action<TRow, string> setId)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<TRow> | rows | |
| string | previousWaveSetId | |
| string | newWaveSetId | |
| Func<TRow, string> | getId | |
| Action<TRow, string> | setId |
Type Parameters
| Name | Description |
|---|---|
| TRow |
Remarks
Takes getId/setId instead of a shared row interface because
Unity's [Serializable] window state classes are plain fields, not implementers of a common
contract — this keeps the method reusable without forcing an interface onto UI state that exists only
to be drawn and serialized.