Inheritance: IExposable
Exemplo n.º 1
0
        public ManagerTab_Power()
        {
            // get list of thingdefs set to use the power comps - this should be static throughout the game (barring added mods midgame)
            _traderDefs = GetTraderDefs().ToList();
            _batteryDefs = GetBatteryDefs().ToList();

            // get a dictionary of powercomps actually existing on the map for each thingdef.
            RefreshCompLists();

            // set up the history trackers.
            tradingHistory =
                new History(
                    _traderDefs.Select(
                        def => new ThingCount( def, Find.ListerBuildings.AllBuildingsColonistOfDef( def ).Count() ) )
                               .ToArray() )
                {
                    DrawOptions = false,
                    DrawInlineLegend = false,
                    Suffix = "W",
                    DrawInfoInBar = true,
                    DrawMaxMarkers = true
                };

            overallHistory = new History( new[] { "Production", "Consumption", "Batteries" } )
            {
                DrawOptions = false,
                DrawInlineLegend = false,
                Suffix = "W",
                DrawIcons = false,
                DrawCounts = false,
                DrawInfoInBar = true,
                DrawMaxMarkers = true,
                MaxPerChapter = true
            };
        }
Exemplo n.º 2
0
        public ManagerJob_Foraging()
        {
            // all plants that yield something, and it isn't wood.
            AllowedPlants = Find.Map.Biome.AllWildPlants
                                .Where( plant => plant.plant.harvestYield > 0 &&
                                                 plant.plant.harvestedThingDef != null &&
                                                 plant.plant.harvestTag != "Wood" )
                                .ToDictionary( k => k, v => false );

            // add cave world fauna
            List<ThingDef> caveWorldFauna = DefDatabase<ThingDef>.AllDefsListForReading.Where( def => def.plant?.sowTags.Contains( "Fungiponics" ) ?? false ).ToList();
            foreach ( var fungus in caveWorldFauna )
            {
                AllowedPlants.Add( fungus, false );
            }

            // populate the trigger field, count all harvested thingdefs from the allowed plant list
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            foreach ( var plant in AllowedPlants.Keys )
            {
                Trigger.ThresholdFilter.SetAllow( plant.plant.harvestedThingDef, true );
            }

            // create History tracker
            History = new History( new[] { "stock", "designated" }, new[] { Color.white, Color.grey } );
        }
        public ManagerJob_Livestock( Manager manager )
            : base(manager)
        {
            // init designations
            Designations = new List<Designation>();

            // start history tracker
            _history = new History( Utilities_Livestock.AgeSexArray.Select( ageSex => ageSex.ToString() ).ToArray() );

            // set up the trigger, set all target counts to 5
            Trigger = new Trigger_PawnKind( this.manager );

            // set all training to false
            Training = new TrainingTracker();

            // set areas for restriction and taming to unrestricted
            TameArea = null;
            RestrictToArea = false;
            RestrictArea = Utilities_Livestock.AgeSexArray.Select( k => (Area) null ).ToList();

            // set defaults for boolean options
            TryTameMore = false;
            ButcherExcess = true;
            ButcherTrained = false;
        }
Exemplo n.º 4
0
        public ManagerJob_Production( RecipeDef recipe )
        {
            Bill = recipe.UsesUnfinishedThing ? new Bill_ProductionWithUft( recipe ) : new Bill_Production( recipe );
            _hasMeaningfulIngredientChoices = Dialog_CreateJobsForIngredients.HasPrerequisiteChoices( recipe );
            MainProduct = new MainProductTracker( Bill.recipe );
            Trigger = new Trigger_Threshold( this );
            BillGivers = new BillGiverTracker( this );

            History = new History( new[] { Trigger.ThresholdFilter.Summary } );
        }
Exemplo n.º 5
0
        public ManagerJob_Hunting()
        {
            // populate the trigger field, set the root category to meats and allow all but human meat.
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow( Utilities_Hunting.RawMeat, true );
            Trigger.ThresholdFilter.SetAllow( Utilities_Hunting.HumanMeat, false );

            // populate the list of animals from the animals in the biome - allow all by default.
            AllowedAnimals = Find.Map.Biome.AllWildAnimals.ToDictionary( pk => pk, v => true );

            History = new History( new[] { "stock", "corpses", "designated" },
                                   new Color[] { Color.white, new Color( .7f, .7f, .7f ), new Color( .4f, .4f, .4f ) } );
        }
Exemplo n.º 6
0
        public ManagerJob_Forestry()
        {
            // populate the trigger field, set the root category to meats and allow all but human meat.
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow( Utilities_Forestry.Wood, true );

            // populate the list of trees from the plants in the biome - allow all by default.
            // A tree is defined as any plant that yields wood
            AllowedTrees =
                Find.Map.Biome.AllWildPlants.Where( pd => pd.plant.harvestedThingDef == Utilities_Forestry.Wood )
                    .ToDictionary( pk => pk, v => true );

            History = new History( new[] { "stock", "designated" }, new[] { Color.white, Color.grey } );
        }
        public ManagerJob_Forestry( Manager manager )
            : base(manager)
        {
            // populate the trigger field, set the root category to wood.
            Trigger = new Trigger_Threshold( this );
            Trigger.ThresholdFilter.SetDisallowAll();
            Trigger.ThresholdFilter.SetAllow( Utilities_Forestry.Wood, true );

            // populate the list of trees from the plants in the biome - allow all by default.
            // A tree is defined as any plant that yields wood or has a wood harvesting tag.
            AllowedTrees =
                manager.map.Biome.AllWildPlants.Where(
                                              pd =>
                                              pd.plant.harvestTag == "Wood" ||
                                              pd.plant.harvestedThingDef == Utilities_Forestry.Wood )
                    // add harvesttag to allow non-wood yielding woody plants.
                   .ToDictionary( pk => pk, v => true );

            // initialize clearAreas list with current areas
            UpdateClearAreas();

            History = new History( new[] {"stock", "designated"}, new[] {Color.white, Color.grey} );
        }