Team stat
This stat is based on an enum
.
namespace MyProject {
public enum ETeam {
Light,
Dark
}
}
using EODE.Wonderland;
using UnityEngine;
namespace MyProject {
[AddComponentMenu("")]
public class TeamStat : StatBase<short> {
public override string EditorTitle => GetType().Name.Replace("Stat", "") + " : " + (ETeam) Value;
public ETeam Team {
get {
return (ETeam) Value;
}
set {
Value = (short) value;
}
}
public bool IsEqual(GameEntity other) {
if (other == null) return false;
var team = other.GetComponent<TeamStat>();
if (team != null) {
return team.Value == Value;
}
return false;
}
public static bool IsEqual(GameEntity A, GameEntity B) {
if (A == null || B == null) return false;
var ta = A.GetComponent<TeamStat>();
if (ta != null) {
return ta.IsEqual(B);
}
return false;
}
}
}