CaveworldFlora.Cluster.NotifyPlantAdded C# (CSharp) Method

NotifyPlantAdded() public method

public NotifyPlantAdded ( ) : void
return void
        public void NotifyPlantAdded()
        {
            this.actualSize++;
            this.UpdateClusterPosition();
        }

Usage Example

示例#1
0
        /// <summary>
        /// Try to spawn another plant in this cluster.
        /// </summary>
        public static ClusterPlant TryGrowCluster(Cluster cluster)
        {
            IntVec3 spawnCell = IntVec3.Invalid;

            TryGetRandomSpawnCellNearCluster(cluster, out spawnCell);
            if (spawnCell.IsValid)
            {
                ClusterPlant newPlant = ThingMaker.MakeThing(cluster.plantDef) as ClusterPlant;
                GenSpawn.Spawn(newPlant, spawnCell, cluster.Map);
                newPlant.cluster = cluster;
                cluster.NotifyPlantAdded();
                if (cluster.plantDef.isSymbiosisPlant)
                {
                    // Destroy source symbiosis plant.
                    Thing sourceSymbiosisPlant = spawnCell.GetFirstThing(cluster.Map, cluster.plantDef.symbiosisPlantDefSource);
                    if (sourceSymbiosisPlant != null)
                    {
                        sourceSymbiosisPlant.Destroy();
                    }
                }
                return(newPlant);
            }
            else
            {
                return(null);
            }
        }
All Usage Examples Of CaveworldFlora.Cluster::NotifyPlantAdded