Example #1
0
        public static void ServerInitCharacterTechnologies(PlayerCharacterTechnologies technologies)
        {
            foreach (var techGroup in FindProtoEntities <TechGroup>())
            {
                if (techGroup.GroupRequirements.Count > 0)
                {
                    continue;
                }

                // add free group
                technologies.ServerAddGroup(techGroup);

                foreach (var techNode in techGroup.RootNodes)
                {
                    ProcessNode(techNode);
                }
            }

            void ProcessNode(TechNode techNode)
            {
                if (techNode.LearningPointsPrice > 0)
                {
                    return;
                }

                // add free node
                technologies.ServerAddNode(techNode);

                foreach (var dependentNode in techNode.DependentNodes)
                {
                    ProcessNode(dependentNode);
                }
            }
        }
Example #2
0
        /// <summary>
        /// This method ensures that free tech groups are added automatically.
        /// </summary>
        private static void ServerEnsureFreeTechGroupsUnlocked(PlayerCharacterTechnologies technologies)
        {
            foreach (var techGroup in TechGroup.AvailableTechGroups)
            {
                if (techGroup.LearningPointsPrice > 0 ||
                    techGroup.GroupRequirements.Count > 0)
                {
                    continue;
                }

                technologies.ServerAddGroup(techGroup);
            }
        }