public void ReplaceGameServiceLogService(Game.Service.ILogService newLogService) { var index = ServiceComponentsLookup.GameServiceLogService; var component = (Game.Service.LogServiceComponent)CreateComponent(index, typeof(Game.Service.LogServiceComponent)); component.LogService = newLogService; ReplaceComponent(index, component); }
public ServiceEntity SetGameServiceLogService(Game.Service.ILogService newLogService) { if (hasGameServiceLogService) { throw new Entitas.EntitasException("Could not set GameServiceLogService!\n" + this + " already has an entity with Game.Service.LogServiceComponent!", "You should check if the context already has a gameServiceLogServiceEntity before setting it or use context.ReplaceGameServiceLogService()."); } var entity = CreateEntity(); entity.AddGameServiceLogService(newLogService); return(entity); }
public void ReplaceGameServiceLogService(Game.Service.ILogService newLogService) { var entity = gameServiceLogServiceEntity; if (entity == null) { entity = SetGameServiceLogService(newLogService); } else { entity.ReplaceGameServiceLogService(newLogService); } }