27 lines
724 B
C#
Executable File
27 lines
724 B
C#
Executable File
using LiveSplit.Model;
|
|
|
|
namespace LiveSplit.TZA.Splits;
|
|
|
|
internal class StageChange : ISplit {
|
|
private uint Stage { get; }
|
|
|
|
internal StageChange(uint stage) {
|
|
this.Stage = stage;
|
|
}
|
|
|
|
public LogicResult Calculate(TimerPhase phase, GameMemory memory) {
|
|
if (phase != TimerPhase.Running) {
|
|
return LogicResult.None;
|
|
}
|
|
|
|
// previous stage being 0 means either new game, trial, or loading save
|
|
if (!memory.Stage.Changed || memory.Stage.Old == 0 || memory.Stage.Current != this.Stage) {
|
|
return LogicResult.None;
|
|
}
|
|
|
|
return LogicResult.Split;
|
|
}
|
|
|
|
public string GetHumanName() => $"When the game stage advances to {this.Stage}";
|
|
}
|