public Services(IViewService view, IInputService input, IHudTextService hud, IPhysicService physic) { View = view; inputService = input; hudService = hud; PhysicService = physic; }
public void ReplacePhysicService(IPhysicService newPhysicService) { var index = MetaComponentsLookup.PhysicService; var component = (PhysicServiceComponent)CreateComponent(index, typeof(PhysicServiceComponent)); component.PhysicService = newPhysicService; ReplaceComponent(index, component); }
public MetaEntity SetPhysicService(IPhysicService newPhysicService) { if (hasPhysicService) { throw new Entitas.EntitasException("Could not set PhysicService!\n" + this + " already has an entity with PhysicServiceComponent!", "You should check if the context already has a physicServiceEntity before setting it or use context.ReplacePhysicService()."); } var entity = CreateEntity(); entity.AddPhysicService(newPhysicService); return(entity); }
public void ReplacePhysicService(IPhysicService newPhysicService) { var entity = physicServiceEntity; if (entity == null) { entity = SetPhysicService(newPhysicService); } else { entity.ReplacePhysicService(newPhysicService); } }
public RegisterPhysicServiceSystem(Contexts contexts, IPhysicService physicService) { _metaContext = contexts.meta; _physicService = physicService; }