CaveworldFlora.ClusterPlant_DevilTongue.Tick C# (CSharp) Method

Tick() public method

Main function: - look for nearby pawn: if any is found, close flower and glower. - when pawn is away, re-open flower after a delay.
public Tick ( ) : void
return void
        public override void Tick()
        {
            if (Find.TickManager.TicksGame >= this.nextLongTick)
            {
                this.nextLongTick += GenTicks.TickLongInterval;
                base.TickLong();
            }

            if (base.Destroyed)
            {
                Log.Warning("ClusterPlant_DevilTongue:Tick: already destroyed at " + this.Position.ToString()); // TODO: debug.
                return;
            }
            switch (flowerState)
            {
                case FlowerState.closed:
                    if (this.isInCryostasis)
                    {
                        break;
                    }
                    if (this.growthInt < 0.3f)
                    {
                        break;
                    }
                    LookForNearbyPawnWhenClosed();
                    break;
                case FlowerState.opening:
                    OpenFlower();
                    break;
                case FlowerState.opened:
                    if (this.isInCryostasis)
                    {
                        TransitionToClosing();
                        break;
                    }
                    LookForNearbyPawnWhenOpened();
                    break;
                case FlowerState.closing:
                    CloseFlower();
                    break;
            }
        }