internal static BaseManager FindManager(SubRoot subRoot)
        {
            QuickLogger.Debug($"Processing SubRoot = {subRoot.GetInstanceID()} || Name {subRoot.GetSubName()}");
            var g       = FindManager(subRoot.gameObject.GetComponentInChildren <PrefabIdentifier>()?.Id);
            var manager = Managers.Find(x => x.InstanceID == g?.InstanceID && x.Habitat == subRoot);

            return(manager ?? CreateNewManager(subRoot));
        }
        public SoccerTeamDetailsViewModel(Team team, IChangeManager changesManager, CollectionFactory collections)
        {
            _changesManager = changesManager;
            _teamModel      = team;

            Collections = collections;

            Managers = Collections.ManagerViewModels;

            TeamDetails         = new TeamViewModel(_teamModel, _changesManager, Collections);
            TeamDetails.Manager = Managers.Find(p => p.Id == TeamDetails.Manager.Id);

            SetTeamSquadDetails();
        }
        internal static BaseManager FindManager(SubRoot subRoot)
        {
            QuickLogger.Debug($"Processing SubRoot = {subRoot.GetInstanceID()} || Name {subRoot.GetSubName()}");

            var pre = subRoot.gameObject.GetComponent <PrefabIdentifier>();

            var manager = Managers.Find(x => x.InstanceID == subRoot.GetInstanceID() && x.Habitat == subRoot);

            if (manager == null)
            {
                QuickLogger.Debug("No manager found on base");
            }

            return(manager ?? CreateNewManager(subRoot));
        }
Пример #4
0
        internal static BaseManager FindManager(SubRoot subRoot)
        {
            if (subRoot == null || !subRoot.isBase)
            {
                return(null);
            }

            var manager = Managers.Find(x => x.InstanceID == subRoot.GetInstanceID() && x.Habitat == subRoot);

            if (manager == null)
            {
                QuickLogger.Debug("No manager found on base");
            }

            return(manager ?? CreateNewManager(subRoot));
        }
Пример #5
0
 protected override void Activities(Fiber fiber)
 {
     manager = (IServicesManager)Managers.Find($"{serviceName}ServicesManager");
     if (manager == default)
     {
         Debug.LogError(Error = $"No service manager '{serviceName}ServicesManager' in a Managers game object");
     }
     else
     {
         fiber.OnError(exit: true, actor: message => Error = message).Do(Reset)
         .Begin
         .WaitFor(_ => MethodCache.Call(serviceAdapter, "Call", this) as Emitter)
         .Until(_ => (Error == null) || ((serviceAdapter = manager.Next()) == null))
         .If(_ => serviceAdapter == null).Error($"No Server '{serviceName} {entryPointName}' can Respond").End
         .Finish();
     }
 }
        public TeamDetailsViewModel(Manager manager, Application app, ISquadRepository squadRepository, CollectionFactory collections, ViewModelBrowser browser)
        {
            App             = app;
            SquadRepository = squadRepository;
            Collections     = collections;
            Browser         = browser;

            Managers = Collections.ManagerViewModels;

            Team = new TeamViewModel()
            {
                Manager = Managers.Find(m => m.Id == manager.Id)
            };

            Back = new RelayCommand(BackToManagerDetails);
            Save = new RelayCommand(SaveTeam, CanSave);
        }
        internal static BaseManager FindManager(string instanceID)
        {
            var manager = Managers.Find(x => x.InstanceID == instanceID);

            return(manager);
        }
Пример #8
0
 public static T Get <T>() where T : IResourceManager => (T)Managers.Find(x => x.GetType() == typeof(T));
Пример #9
0
 public Manager FindManager(int id)
 {
     return(Managers.Find(id));
 }