//------------------------------------------------------------------------------ // // 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 joystickProxyEntity { get { return GetGroup(CombatMatcher.JoystickProxy).GetSingleEntity(); } } public CoreGame.Render.JoystickProxy joystickProxy { get { return joystickProxyEntity.joystickProxy; } } public bool hasJoystickProxy { get { return joystickProxyEntity != null; } } public CombatEntity SetJoystickProxy(CombatEntity newEnt) { if (hasJoystickProxy) { throw new Entitas.EntitasException("Could not set JoystickProxy!\n" + this + " already has an entity with CoreGame.Render.JoystickProxy!", "You should check if the context already has a joystickProxyEntity before setting it or use context.ReplaceJoystickProxy()."); } var entity = CreateEntity(); entity.AddJoystickProxy(newEnt); return entity; } public void ReplaceJoystickProxy(CombatEntity newEnt) { var entity = joystickProxyEntity; if (entity == null) { entity = SetJoystickProxy(newEnt); } else { entity.ReplaceJoystickProxy(newEnt); } } public void RemoveJoystickProxy() { joystickProxyEntity.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.JoystickProxy joystickProxy { get { return (CoreGame.Render.JoystickProxy)GetComponent(CombatComponentsLookup.JoystickProxy); } } public bool hasJoystickProxy { get { return HasComponent(CombatComponentsLookup.JoystickProxy); } } public void AddJoystickProxy(CombatEntity newEnt) { var index = CombatComponentsLookup.JoystickProxy; var component = (CoreGame.Render.JoystickProxy)CreateComponent(index, typeof(CoreGame.Render.JoystickProxy)); component.ent = newEnt; AddComponent(index, component); } public void ReplaceJoystickProxy(CombatEntity newEnt) { var index = CombatComponentsLookup.JoystickProxy; var component = (CoreGame.Render.JoystickProxy)CreateComponent(index, typeof(CoreGame.Render.JoystickProxy)); component.ent = newEnt; ReplaceComponent(index, component); } public void RemoveJoystickProxy() { RemoveComponent(CombatComponentsLookup.JoystickProxy); } } //------------------------------------------------------------------------------ // // 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 _matcherJoystickProxy; public static Entitas.IMatcher JoystickProxy { get { if (_matcherJoystickProxy == null) { var matcher = (Entitas.Matcher)Entitas.Matcher.AllOf(CombatComponentsLookup.JoystickProxy); matcher.componentNames = CombatComponentsLookup.componentNames; _matcherJoystickProxy = matcher; } return _matcherJoystickProxy; } } }