33 lines
898 B
C#
Executable File
33 lines
898 B
C#
Executable File
using LiveSplit.Model;
|
|
using LiveSplit.TZA.Util;
|
|
|
|
namespace LiveSplit.TZA.Splits;
|
|
|
|
internal class EnterLocationWithStage : ISplit {
|
|
private ushort Location { get; }
|
|
private uint Stage { get; }
|
|
|
|
internal EnterLocationWithStage(ushort location, uint stage) {
|
|
this.Location = location;
|
|
this.Stage = stage;
|
|
}
|
|
|
|
public LogicResult Calculate(TimerPhase phase, GameMemory memory) {
|
|
if (phase != TimerPhase.Running) {
|
|
return LogicResult.None;
|
|
}
|
|
|
|
if (memory.Stage.Current != this.Stage) {
|
|
return LogicResult.None;
|
|
}
|
|
|
|
if (!memory.Location.Changed || memory.Location.Current != this.Location) {
|
|
return LogicResult.None;
|
|
}
|
|
|
|
return LogicResult.Split;
|
|
}
|
|
|
|
public string GetHumanName() => $"After entering {LocationNames.Get(this.Location)} during game stage {this.Stage}";
|
|
}
|