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
4.0 KiB
94 lines
4.0 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 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();
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <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.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);
|
|
}
|
|
}
|
|
|
|
//------------------------------------------------------------------------------
|
|
// <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> _matcherJoystickProxy;
|
|
|
|
public static Entitas.IMatcher<CombatEntity> JoystickProxy {
|
|
get {
|
|
if (_matcherJoystickProxy == null) {
|
|
var matcher = (Entitas.Matcher<CombatEntity>)Entitas.Matcher<CombatEntity>.AllOf(CombatComponentsLookup.JoystickProxy);
|
|
matcher.componentNames = CombatComponentsLookup.componentNames;
|
|
_matcherJoystickProxy = matcher;
|
|
}
|
|
|
|
return _matcherJoystickProxy;
|
|
}
|
|
}
|
|
}
|
|
|