CaveworldFlora.Cluster.Initialize C# (CSharp) Method

Initialize() public method

public Initialize ( ThingDef_ClusterPlant plantDef, int desiredSize ) : void
plantDef ThingDef_ClusterPlant
desiredSize int
return void
        public void Initialize(ThingDef_ClusterPlant plantDef, int desiredSize)
        {
            this.plantDef = plantDef;
            this.actualSize = 1;
            this.desiredSize = desiredSize;
        }

Usage Example

示例#1
0
        // New cluster initialization.
        public static ClusterPlant SpawnNewClusterAt(Map map, IntVec3 spawnCell, ThingDef_ClusterPlant plantDef, int desiredSize)
        {
            ClusterPlant newPlant = ThingMaker.MakeThing(plantDef) as ClusterPlant;

            GenSpawn.Spawn(newPlant, spawnCell, map);
            Cluster newCluster = ThingMaker.MakeThing(Util_CaveworldFlora.ClusterDef) as Cluster;

            newCluster.Initialize(plantDef, desiredSize);
            GenSpawn.Spawn(newCluster, spawnCell, map);
            newPlant.cluster = newCluster;
            return(newPlant);
        }