Beispiel #1
0
        private void UnlockChildrenRecursively(ProtoRDNode parent)
        {
            foreach (var childNode in parent.children)
            {
                UnlockChildrenRecursively(childNode);
            }

            UnlockParent(parent);
        }
Beispiel #2
0
        private void UnlockParent(ProtoRDNode childNode)
        {
            if (childNode.tech.state == RDTech.State.Unavailable)
            {
                return;
            }

            if (childNode.AnyParentToUnlock && childNode.parents.Any(p => p.tech.state == RDTech.State.Available))
            {
                return;
            }

            foreach (ProtoRDNode parentNode in childNode.parents)
            {
                if (parentNode.tech.state == RDTech.State.Available)
                {
                    continue;
                }

                parentNode.tech.state = RDTech.State.Available;
                ResearchAndDevelopment.Instance.SetTechState(parentNode.tech.techID, parentNode.tech);
                ResearchAndDevelopment.Instance.UnlockProtoTechNode(parentNode.tech);
            }
        }