public Entity AddInput(InputIntent newIntent, object[] newData) { var componentPool = GetComponentPool(ComponentIds.Input); var component = (InputComponent)(componentPool.Count > 0 ? componentPool.Pop() : new InputComponent()); component.intent = newIntent; component.data = newData; return AddComponent(ComponentIds.Input, component); }
public Entity AddInput(InputIntent newIntent) { var component = _inputComponentPool.Count > 0 ? _inputComponentPool.Pop() : new InputComponent(); component.intent = newIntent; return(AddComponent(ComponentIds.Input, component)); }
public Entity SetInput(InputIntent newIntent) { if (hasInput) { throw new EntitasException("Could not set input!\n" + this + " already has an entity with InputComponent!", "You should check if the pool already has a inputEntity before setting it or use pool.ReplaceInput()."); } var entity = CreateEntity(); entity.AddInput(newIntent); return entity; }
public Entity AddInput(InputIntent newIntent, object[] newData) { var componentPool = GetComponentPool(ComponentIds.Input); var component = (InputComponent)(componentPool.Count > 0 ? componentPool.Pop() : new InputComponent()); component.intent = newIntent; component.data = newData; return(AddComponent(ComponentIds.Input, component)); }
public Entity ReplaceInput(InputIntent newIntent) { var entity = inputEntity; if (entity == null) { entity = SetInput(newIntent); } else { entity.ReplaceInput(newIntent); } return entity; }
public Entity ReplaceInput(InputIntent newIntent) { var previousComponent = hasInput ? input : null; var component = _inputComponentPool.Count > 0 ? _inputComponentPool.Pop() : new InputComponent(); component.intent = newIntent; ReplaceComponent(ComponentIds.Input, component); if (previousComponent != null) { _inputComponentPool.Push(previousComponent); } return this; }
public Entity ReplaceInput(InputIntent newIntent, object[] newData) { var entity = inputEntity; if (entity == null) { entity = SetInput(newIntent, newData); } else { entity.ReplaceInput(newIntent, newData); } return entity; }
public Entity SetInput(InputIntent newIntent) { if (hasInput) { throw new EntitasException("Could not set input!\n" + this + " already has an entity with InputComponent!", "You should check if the pool already has a inputEntity before setting it or use pool.ReplaceInput()."); } var entity = CreateEntity(); entity.AddInput(newIntent); return(entity); }
public Entity ReplaceInput(InputIntent newIntent) { var previousComponent = hasInput ? input : null; var component = _inputComponentPool.Count > 0 ? _inputComponentPool.Pop() : new InputComponent(); component.intent = newIntent; ReplaceComponent(ComponentIds.Input, component); if (previousComponent != null) { _inputComponentPool.Push(previousComponent); } return(this); }
public Entity ReplaceInput(InputIntent newIntent) { var entity = inputEntity; if (entity == null) { entity = SetInput(newIntent); } else { entity.ReplaceInput(newIntent); } return(entity); }
public Entity ReplaceInput(InputIntent newIntent, object[] newData) { var entity = inputEntity; if (entity == null) { entity = SetInput(newIntent, newData); } else { entity.ReplaceInput(newIntent, newData); } return(entity); }
public Entity AddInput(InputIntent newIntent) { var component = _inputComponentPool.Count > 0 ? _inputComponentPool.Pop() : new InputComponent(); component.intent = newIntent; return AddComponent(ComponentIds.Input, component); }