Npcs/Disposition.cs

Defines NPC relationship types and a small value type pairing a disposition with a priority. The Disposition enum lists Neutral, Friendly, Hostile, and Fearful. Relationship is an immutable record struct holding a Disposition and an integer Priority used to break ties when selecting targets.

namespace Sandbox.Npcs;

/// <summary>
/// How one NPC regards another entity. Drives target selection -- who to fight, follow,
/// ignore, or flee from.
/// </summary>
public enum Disposition
{
	/// <summary>No strong feeling -- ignore them.</summary>
	Neutral,

	/// <summary>An ally -- protect or assist.</summary>
	Friendly,

	/// <summary>An enemy -- attack on sight.</summary>
	Hostile,

	/// <summary>A threat to avoid -- flee from them.</summary>
	Fearful,
}

/// <summary>
/// A disposition plus a priority. Priority breaks ties when an NPC must choose between
/// several valid targets -- higher wins.
/// </summary>
public readonly record struct Relationship( Disposition Disposition, int Priority = 0 );