//------------------------------------------------------------------------------ // // This code was generated by Entitas.CodeGeneration.Plugins.ComponentContextApiGenerator. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ public partial class CombatContext { public CombatEntity renderTimerEntity { get { return GetGroup(CombatMatcher.RenderTimer).GetSingleEntity(); } } public CoreGame.Render.RenderTimerComponent renderTimer { get { return renderTimerEntity.renderTimer; } } public bool hasRenderTimer { get { return renderTimerEntity != null; } } public CombatEntity SetRenderTimer(int newIdGen) { if (hasRenderTimer) { throw new Entitas.EntitasException("Could not set RenderTimer!\n" + this + " already has an entity with CoreGame.Render.RenderTimerComponent!", "You should check if the context already has a renderTimerEntity before setting it or use context.ReplaceRenderTimer()."); } var entity = CreateEntity(); entity.AddRenderTimer(newIdGen); return entity; } public void ReplaceRenderTimer(int newIdGen) { var entity = renderTimerEntity; if (entity == null) { entity = SetRenderTimer(newIdGen); } else { entity.ReplaceRenderTimer(newIdGen); } } public void RemoveRenderTimer() { renderTimerEntity.Destroy(); } } //------------------------------------------------------------------------------ // // 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 { public CoreGame.Render.RenderTimerComponent renderTimer { get { return (CoreGame.Render.RenderTimerComponent)GetComponent(CombatComponentsLookup.RenderTimer); } } public bool hasRenderTimer { get { return HasComponent(CombatComponentsLookup.RenderTimer); } } public void AddRenderTimer(int newIdGen) { var index = CombatComponentsLookup.RenderTimer; var component = (CoreGame.Render.RenderTimerComponent)CreateComponent(index, typeof(CoreGame.Render.RenderTimerComponent)); component.idGen = newIdGen; AddComponent(index, component); } public void ReplaceRenderTimer(int newIdGen) { var index = CombatComponentsLookup.RenderTimer; var component = (CoreGame.Render.RenderTimerComponent)CreateComponent(index, typeof(CoreGame.Render.RenderTimerComponent)); component.idGen = newIdGen; ReplaceComponent(index, component); } public void RemoveRenderTimer() { RemoveComponent(CombatComponentsLookup.RenderTimer); } } //------------------------------------------------------------------------------ // // 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 _matcherRenderTimer; public static Entitas.IMatcher RenderTimer { get { if (_matcherRenderTimer == null) { var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(CombatComponentsLookup.RenderTimer); matcher.componentNames = CombatComponentsLookup.componentNames; _matcherRenderTimer = matcher; } return _matcherRenderTimer; } } }