231 lines
7.2 KiB
C#
231 lines
7.2 KiB
C#
using System.Numerics;
|
|
using System.Runtime.CompilerServices;
|
|
using SmartNav.Model;
|
|
using SmartNav.Model.Navigation;
|
|
|
|
namespace SmartNav.Graph;
|
|
|
|
public abstract record NavNode(string Id, uint TerritoryId, Vector3 Position)
|
|
{
|
|
public sealed record AetheryteNode : NavNode
|
|
{
|
|
public EAetheryteLocation Aetheryte { get; init; }
|
|
|
|
public override string Label => Aetheryte.ToString();
|
|
|
|
public AetheryteNode(EAetheryteLocation Aetheryte, uint TerritoryId, Vector3 Position)
|
|
{
|
|
this.Aetheryte = Aetheryte;
|
|
base._002Ector($"aetheryte:{Aetheryte}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out EAetheryteLocation Aetheryte, out uint TerritoryId, out Vector3 Position)
|
|
{
|
|
Aetheryte = this.Aetheryte;
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
}
|
|
}
|
|
|
|
public sealed record AethernetNode : NavNode
|
|
{
|
|
public EAetheryteLocation Aethernet { get; init; }
|
|
|
|
public EAetheryteLocation ParentAetheryte { get; init; }
|
|
|
|
public override string Label => Aethernet.ToString();
|
|
|
|
public AethernetNode(EAetheryteLocation Aethernet, uint TerritoryId, Vector3 Position, EAetheryteLocation ParentAetheryte)
|
|
{
|
|
this.Aethernet = Aethernet;
|
|
this.ParentAetheryte = ParentAetheryte;
|
|
base._002Ector($"aethernet:{Aethernet}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out EAetheryteLocation Aethernet, out uint TerritoryId, out Vector3 Position, out EAetheryteLocation ParentAetheryte)
|
|
{
|
|
Aethernet = this.Aethernet;
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
ParentAetheryte = this.ParentAetheryte;
|
|
}
|
|
}
|
|
|
|
public sealed record ZoneBoundaryNode : NavNode
|
|
{
|
|
public string BoundaryId { get; init; }
|
|
|
|
public string PairedNodeId { get; init; }
|
|
|
|
public bool RequiresFlying { get; init; }
|
|
|
|
public uint? RequiredQuestId { get; init; }
|
|
|
|
public TriggerBox? Trigger { get; init; }
|
|
|
|
public override string Label => "boundary (" + BoundaryId + ")";
|
|
|
|
public ZoneBoundaryNode(string BoundaryId, uint TerritoryId, Vector3 Position, string PairedNodeId, bool RequiresFlying = false, uint? RequiredQuestId = null, TriggerBox? Trigger = null)
|
|
{
|
|
this.BoundaryId = BoundaryId;
|
|
this.PairedNodeId = PairedNodeId;
|
|
this.RequiresFlying = RequiresFlying;
|
|
this.RequiredQuestId = RequiredQuestId;
|
|
this.Trigger = Trigger;
|
|
base._002Ector($"boundary:{BoundaryId}:{TerritoryId}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out string BoundaryId, out uint TerritoryId, out Vector3 Position, out string PairedNodeId, out bool RequiresFlying, out uint? RequiredQuestId, out TriggerBox? Trigger)
|
|
{
|
|
BoundaryId = this.BoundaryId;
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
PairedNodeId = this.PairedNodeId;
|
|
RequiresFlying = this.RequiresFlying;
|
|
RequiredQuestId = this.RequiredQuestId;
|
|
Trigger = this.Trigger;
|
|
}
|
|
}
|
|
|
|
public sealed record WarpNode : NavNode
|
|
{
|
|
public uint WarpRowId { get; init; }
|
|
|
|
public uint? NpcDataId { get; init; }
|
|
|
|
public uint[] RequiredQuestIds { get; init; }
|
|
|
|
public int GilCost { get; init; }
|
|
|
|
public uint[]? AvailableDuringMsqIds { get; init; }
|
|
|
|
public ushort RequiredClassLevel { get; init; }
|
|
|
|
public bool RequireAllQuests { get; init; }
|
|
|
|
public override string Label => $"warp {WarpRowId}";
|
|
|
|
public WarpNode(uint WarpRowId, uint TerritoryId, Vector3 Position, uint? NpcDataId, uint[] RequiredQuestIds, int GilCost, uint[]? AvailableDuringMsqIds = null, ushort RequiredClassLevel = 0, bool RequireAllQuests = true)
|
|
{
|
|
this.WarpRowId = WarpRowId;
|
|
this.NpcDataId = NpcDataId;
|
|
this.RequiredQuestIds = RequiredQuestIds;
|
|
this.GilCost = GilCost;
|
|
this.AvailableDuringMsqIds = AvailableDuringMsqIds;
|
|
this.RequiredClassLevel = RequiredClassLevel;
|
|
this.RequireAllQuests = RequireAllQuests;
|
|
base._002Ector($"warp:{WarpRowId}:{NpcDataId.GetValueOrDefault()}:{TerritoryId}:{Position.X:F1}:{Position.Y:F1}:{Position.Z:F1}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out uint WarpRowId, out uint TerritoryId, out Vector3 Position, out uint? NpcDataId, out uint[] RequiredQuestIds, out int GilCost, out uint[]? AvailableDuringMsqIds, out ushort RequiredClassLevel, out bool RequireAllQuests)
|
|
{
|
|
WarpRowId = this.WarpRowId;
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
NpcDataId = this.NpcDataId;
|
|
RequiredQuestIds = this.RequiredQuestIds;
|
|
GilCost = this.GilCost;
|
|
AvailableDuringMsqIds = this.AvailableDuringMsqIds;
|
|
RequiredClassLevel = this.RequiredClassLevel;
|
|
RequireAllQuests = this.RequireAllQuests;
|
|
}
|
|
}
|
|
|
|
public sealed record ChocoboTaxiNode : NavNode
|
|
{
|
|
public uint StandRowId { get; init; }
|
|
|
|
public uint NpcDataId { get; init; }
|
|
|
|
public override string Label => $"taxi {StandRowId}";
|
|
|
|
public ChocoboTaxiNode(uint StandRowId, uint TerritoryId, Vector3 Position, uint NpcDataId)
|
|
{
|
|
this.StandRowId = StandRowId;
|
|
this.NpcDataId = NpcDataId;
|
|
base._002Ector($"taxi:{StandRowId}:{TerritoryId}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out uint StandRowId, out uint TerritoryId, out Vector3 Position, out uint NpcDataId)
|
|
{
|
|
StandRowId = this.StandRowId;
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
NpcDataId = this.NpcDataId;
|
|
}
|
|
}
|
|
|
|
public sealed record SubRegionConnectorNode : NavNode
|
|
{
|
|
public string SubRegionId { get; init; }
|
|
|
|
public int ConnectorIndex { get; init; }
|
|
|
|
public SubRegionConnectorKind Kind { get; init; }
|
|
|
|
public override string Label => "connector (" + SubRegionId + ")";
|
|
|
|
public SubRegionConnectorNode(uint TerritoryId, Vector3 Position, string SubRegionId, int ConnectorIndex, SubRegionConnectorKind Kind = SubRegionConnectorKind.Pad)
|
|
{
|
|
this.SubRegionId = SubRegionId;
|
|
this.ConnectorIndex = ConnectorIndex;
|
|
this.Kind = Kind;
|
|
base._002Ector($"connector:{TerritoryId}:{ConnectorIndex}:{SubRegionId}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out uint TerritoryId, out Vector3 Position, out string SubRegionId, out int ConnectorIndex, out SubRegionConnectorKind Kind)
|
|
{
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
SubRegionId = this.SubRegionId;
|
|
ConnectorIndex = this.ConnectorIndex;
|
|
Kind = this.Kind;
|
|
}
|
|
}
|
|
|
|
public sealed record TicketNode : NavNode
|
|
{
|
|
public uint ItemId { get; init; }
|
|
|
|
public override string Label => $"ticket {ItemId}";
|
|
|
|
public TicketNode(uint ItemId, uint TerritoryId, Vector3 Position)
|
|
{
|
|
this.ItemId = ItemId;
|
|
base._002Ector($"ticket:{ItemId}:{TerritoryId}", TerritoryId, Position);
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out uint ItemId, out uint TerritoryId, out Vector3 Position)
|
|
{
|
|
ItemId = this.ItemId;
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
}
|
|
}
|
|
|
|
public sealed record PositionNode : NavNode
|
|
{
|
|
public override string Label => $"position ({base.Position.X:F0}, {base.Position.Z:F0})";
|
|
|
|
public PositionNode(uint TerritoryId, Vector3 Position)
|
|
: base($"pos:{TerritoryId}:{Position.X:F1}:{Position.Y:F1}:{Position.Z:F1}", TerritoryId, Position)
|
|
{
|
|
}
|
|
|
|
[CompilerGenerated]
|
|
public void Deconstruct(out uint TerritoryId, out Vector3 Position)
|
|
{
|
|
TerritoryId = base.TerritoryId;
|
|
Position = base.Position;
|
|
}
|
|
}
|
|
|
|
public abstract string Label { get; }
|
|
}
|