Ejemplo n.º 1
0
        private void DependencyChangedState(PlayerState state, ResearchDefinition rd)
        {
            CheckAutostart(state, rd);
            var research = state.PlayerResearchState(rd.Id);

            if (research != null)
            {
                UpdateStatefulStorage(research);
                CheckCompletion(research);
            }
        }
Ejemplo n.º 2
0
 private void CheckAutostart(PlayerState state, ResearchDefinition rd)
 {
     if (!rd.AutoStart)
     {
         return;
     }
     if (rd.Trigger.BranchesWithPrereqs(state.ResearchState, state.HasUnlocked).Any() &&
         state.ResearchState(rd.Id) == ResearchState.NotStarted)
     {
         state.PlayerResearchState(rd.Id, true).State = ResearchState.InProgress;
     }
 }
Ejemplo n.º 3
0
 public PlayerResearchState(PlayerState player, ResearchDefinition def)
 {
     Player     = player;
     Definition = def;
 }