You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
3.9 KiB
94 lines
3.9 KiB
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// 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.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
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();
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// 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.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
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);
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// 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.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
public sealed partial class CombatMatcher {
|
|
|
|
static Entitas.IMatcher<CombatEntity> _matcherRenderTimer;
|
|
|
|
public static Entitas.IMatcher<CombatEntity> RenderTimer {
|
|
get {
|
|
if (_matcherRenderTimer == null) {
|
|
var matcher = (Entitas.Matcher<CombatEntity>)Entitas.Matcher<CombatEntity>.AllOf(CombatComponentsLookup.RenderTimer);
|
|
matcher.componentNames = CombatComponentsLookup.componentNames;
|
|
_matcherRenderTimer = matcher;
|
|
}
|
|
|
|
return _matcherRenderTimer;
|
|
}
|
|
}
|
|
}
|
|
|