2022-11-19 21:21:12 -08:00
|
|
|
using Godot;
|
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
namespace SupaLidlGame.Utils;
|
|
|
|
|
2024-06-01 19:12:23 -07:00
|
|
|
[System.Flags]
|
|
|
|
public enum FactionName
|
|
|
|
{
|
|
|
|
Player = 1,
|
|
|
|
Doc = 2,
|
2024-06-09 08:36:41 -07:00
|
|
|
Forest = 4,
|
2024-06-01 19:12:23 -07:00
|
|
|
}
|
|
|
|
|
2023-06-03 18:21:46 -07:00
|
|
|
public interface IFaction
|
2022-11-19 21:21:12 -08:00
|
|
|
{
|
2023-06-03 18:21:46 -07:00
|
|
|
/// <summary>
|
|
|
|
/// The faction index that this entity belongs to.
|
|
|
|
/// </summary>
|
|
|
|
[Export]
|
2024-06-01 19:12:23 -07:00
|
|
|
public FactionName Faction { get; set; }
|
2024-05-18 15:53:33 -07:00
|
|
|
|
|
|
|
public bool AlignsWith(IFaction other)
|
|
|
|
{
|
|
|
|
return (Faction & other.Faction) > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool AlignsFullyWith(IFaction other)
|
|
|
|
{
|
|
|
|
return Faction == other.Faction;
|
|
|
|
}
|
2022-11-19 21:21:12 -08:00
|
|
|
}
|