Files
trail-into-darkness/Packages/com.jovian.encounter-system/Runtime/EncounterLink.cs
2026-04-20 08:07:24 +02:00

20 lines
647 B
C#

using System;
namespace Jovian.EncounterSystem {
/// <summary>Cross-table reference. Rename-safe — the stored key is a GUID.</summary>
[Serializable]
public struct EncounterLink {
public EncounterTable table;
public string internalId;
/// <summary>O(1) lookup via <see cref="EncounterTable.Resolve"/>. Returns <c>null</c> if the
/// table is missing or the id can't be found.</summary>
public IEncounter Resolve() {
if(table == null || string.IsNullOrEmpty(internalId)) {
return null;
}
return table.Resolve(internalId);
}
}
}