Ejemplo n.º 1
0
        public List <Def> GetResearchRequirements()
        {
            if (ResearchConsolidator != this)
            {
                return(ResearchConsolidator.GetResearchRequirements());
            }

            // Return the list of research required
            return(researchDefs.ConvertAll <Def>(def => (Def)def));
        }
Ejemplo n.º 2
0
        public List <RecipeDef> GetRecipesUnlocked(ref List <ThingDef> thingdefs)
        {
            if (ResearchConsolidator != this)
            {
                return(ResearchConsolidator.GetRecipesUnlocked(ref thingdefs));
            }

            // Recipes on buildings it unlocks
            var recipedefs = new List <RecipeDef>();

            if (thingdefs != null)
            {
                thingdefs.Clear();
            }

            // Look at this def
            if (
                (!HideDefs) &&
                (IsRecipeToggle)
                )
            {
                recipedefs.AddRangeUnique(recipeDefs);
                if (thingdefs != null)
                {
                    thingdefs.AddRangeUnique(thingDefs);
                }
            }

            // Look in matching research
            if (!MatchingAdvancedResearch.NullOrEmpty())
            {
                foreach (var a in MatchingAdvancedResearch)
                {
                    if (
                        (!a.HideDefs) &&
                        (a.IsRecipeToggle)
                        )
                    {
                        recipedefs.AddRangeUnique(a.recipeDefs);
                        if (thingdefs != null)
                        {
                            thingdefs.AddRangeUnique(a.thingDefs);
                        }
                    }
                }
            }

            return(recipedefs);
        }
Ejemplo n.º 3
0
        public List <string> GetSowTagsLocked(ref List <ThingDef> thingdefs)
        {
            if (ResearchConsolidator != this)
            {
                return(ResearchConsolidator.GetSowTagsLocked(ref thingdefs));
            }

            // Sow tags on plants it unlocks
            var sowtags = new List <string>();

            if (thingdefs != null)
            {
                thingdefs.Clear();
            }

            // Look at this def
            if (
                (HideDefs) &&
                (IsPlantToggle)
                )
            {
                sowtags.AddRangeUnique(sowTags);
                if (thingdefs != null)
                {
                    thingdefs.AddRangeUnique(thingDefs);
                }
            }

            // Look in matching research
            if (!MatchingAdvancedResearch.NullOrEmpty())
            {
                foreach (var a in MatchingAdvancedResearch)
                {
                    if (
                        (a.HideDefs) &&
                        (a.IsPlantToggle)
                        )
                    {
                        sowtags.AddRangeUnique(a.sowTags);
                        if (thingdefs != null)
                        {
                            thingdefs.AddRangeUnique(a.thingDefs);
                        }
                    }
                }
            }

            return(sowtags);
        }
Ejemplo n.º 4
0
        public List <ThingDef> GetThingsLocked()
        {
            if (ResearchConsolidator != this)
            {
                return(ResearchConsolidator.GetThingsLocked());
            }

            // Buildings it locks
            var thingdefs = new List <ThingDef>();

            // Look at this def
            if (
                (HideDefs) &&
                (IsBuildingToggle)
                )
            {
                thingdefs.AddRangeUnique(thingDefs);
            }

            // Look in matching research
            if (!MatchingAdvancedResearch.NullOrEmpty())
            {
                foreach (var a in MatchingAdvancedResearch)
                {
                    if (
                        (a.HideDefs) &&
                        (a.IsBuildingToggle)
                        )
                    {
                        thingdefs.AddRangeUnique(a.thingDefs);
                    }
                }
            }

            return(thingdefs);
        }
Ejemplo n.º 5
0
        public List <Def> GetResearchLocked()
        {
            if (ResearchConsolidator != this)
            {
                return(ResearchConsolidator.GetResearchLocked());
            }

            // Research it locks
            var researchdefs = new List <Def>();

            // Look at this def
            if (
                (HideDefs) &&
                (IsResearchToggle)
                )
            {
                researchdefs.AddRangeUnique(effectedResearchDefs.ConvertAll <Def>(def => (Def)def));
            }

            // Look in matching research
            if (!MatchingAdvancedResearch.NullOrEmpty())
            {
                foreach (var a in MatchingAdvancedResearch)
                {
                    if (
                        (a.HideDefs) &&
                        (a.IsResearchToggle)
                        )
                    {
                        researchdefs.AddRangeUnique(a.effectedResearchDefs.ConvertAll <Def>(def => (Def)def));
                    }
                }
            }

            return(researchdefs);
        }