public void ReplaceGameServiceLoadService(Game.Service.ILoadService newLoadService) { var index = ServiceComponentsLookup.GameServiceLoadService; var component = (Game.Service.LoadServiceComponent)CreateComponent(index, typeof(Game.Service.LoadServiceComponent)); component.LoadService = newLoadService; ReplaceComponent(index, component); }
public ServiceEntity SetGameServiceLoadService(Game.Service.ILoadService newLoadService) { if (hasGameServiceLoadService) { throw new Entitas.EntitasException("Could not set GameServiceLoadService!\n" + this + " already has an entity with Game.Service.LoadServiceComponent!", "You should check if the context already has a gameServiceLoadServiceEntity before setting it or use context.ReplaceGameServiceLoadService()."); } var entity = CreateEntity(); entity.AddGameServiceLoadService(newLoadService); return(entity); }
public void ReplaceGameServiceLoadService(Game.Service.ILoadService newLoadService) { var entity = gameServiceLoadServiceEntity; if (entity == null) { entity = SetGameServiceLoadService(newLoadService); } else { entity.ReplaceGameServiceLoadService(newLoadService); } }