//------------------------------------------------------------------------------
//
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentEntityApiGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
public partial class CombatEntity {
static readonly CoreGame.Render.HeroComponent heroComponent = new CoreGame.Render.HeroComponent();
public bool isHero {
get { return HasComponent(CombatComponentsLookup.Hero); }
set {
if (value != isHero) {
var index = CombatComponentsLookup.Hero;
if (value) {
var componentPool = GetComponentPool(index);
var component = componentPool.Count > 0
? componentPool.Pop()
: heroComponent;
AddComponent(index, component);
} else {
RemoveComponent(index);
}
}
}
}
}
//------------------------------------------------------------------------------
//
// This code was generated by Entitas.CodeGeneration.Plugins.ComponentMatcherApiGenerator.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//
//------------------------------------------------------------------------------
public sealed partial class CombatMatcher {
static Entitas.IMatcher _matcherHero;
public static Entitas.IMatcher Hero {
get {
if (_matcherHero == null) {
var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(CombatComponentsLookup.Hero);
matcher.componentNames = CombatComponentsLookup.componentNames;
_matcherHero = matcher;
}
return _matcherHero;
}
}
}