Example #1
0
 public void RemoveSuper(Super super, Action superRemovalCompleteCallback)
 {
     this.mSuperBeingRemoved = super;
     this.mSuperRemovalCompleteCallback = superRemovalCompleteCallback;
     this.mSuperRemovalTickRemaining = 5;
     this.mIsRemovingSuper = true;
 }
Example #2
0
        public void UpdateTick(BeeWorldManager worldManager)
        {
            var lElapsedMinutes = worldManager.ElapsedTime.TotalMinutes;

            const int lcMinimumBeePopulation = 50;

            if (this.mIsSmokingHive && (--this.mSmokingTicksRemaining == 0))
            {
                this.mSmoker = null;
                this.mIsSmokingHive = false;
                this.mSmokingCompleteCallback();
                this.mSmokingCompleteCallback = null;
            }

            if (this.mIsRemovingSuper && (--this.mSuperRemovalTickRemaining == 0))
            {
                this.mBeeHive.Supers.Remove(this.mSuperBeingRemoved);

                this.mSuperBeingRemoved = null;
                this.mIsRemovingSuper = false;
                this.mSuperRemovalCompleteCallback();
                this.mSuperRemovalCompleteCallback = null;
            }

            if (this.mIsRemovingQueen && (--this.mQueenRemovalTicksRemaining == 0))
            {
                var lQueenBee = this.mBeeHive.QueenBee;
                this.mPlayer.QueenBees.Add(lQueenBee);
                this.mBeeHive.QueenBee = null;

                this.mIsRemovingQueen = false;
                this.mQueenRemovalCompleteCallback();
                this.mQueenRemovalCompleteCallback = null;
            }

            if (this.mIsAddingQueen && (--this.mQueenAddTicksRemaining == 0))
            {
                this.mBeeHive.QueenBee = this.mQueenBeeToAdd;
                this.mPlayer.QueenBees.Remove(this.mQueenBeeToAdd);

                this.mIsAddingQueen = false;
                this.mQueenBeeToAdd = null;
                this.mQueenAddCompleteCallback();
                this.mQueenAddCompleteCallback = null;
            }

            int lQueenPopulationFactor = 0;
            int lQueenStrengthFactor = 0;
            int lQueenAgressionFactor = 5;
            int lQueenSwarmFactor = 0;

            if (this.mBeeHive.QueenBee != null)
            {
                lQueenPopulationFactor = this.mBeeHive.QueenBee.BeePopulationGrowthFactor;
                lQueenStrengthFactor = this.mBeeHive.QueenBee.ColonyStrengthFactor;
                lQueenAgressionFactor = this.mBeeHive.QueenBee.NaturalBeeAgressionFactor;
                lQueenSwarmFactor = this.mBeeHive.QueenBee.SwarmLikelinessFactor;
            }

            var lNewPopulation = this.CalculateNewPopulation(
                lElapsedMinutes, this.mBeeHive.Population, lQueenPopulationFactor);
            this.mBeeHive.Population = Math.Max(lcMinimumBeePopulation, lNewPopulation);

            this.mBeeHive.ColonyStrength = this.CalculateColonyStrenth(
                this.mBeeHive.Population, lQueenStrengthFactor);

            this.mBeeHive.ColonyAgressiveness = this.CalculateNewColonyAgression(
                lElapsedMinutes, this.mBeeHive.ColonyAgressiveness, lNewPopulation, lQueenAgressionFactor);

            this.mBeeHive.ColonySwarmLikeliness = this.CalculateNewColonySwarmLikliness(
                this.mBeeHive.ColonySwarmLikeliness, lNewPopulation, lQueenSwarmFactor, this.mBeeYard.GrassGrowth);

            this.UpdateHoneyCollection(lElapsedMinutes);
        }
Example #3
0
 public void AddSuper(Super super, SuperType type)
 {
     this.mBeeHive.Supers.Add(super, type);
 }
Example #4
0
 private InventoryItem ToInventoryItem(Super super)
 {
     var lInventoryItem = new InventoryItem();
     lInventoryItem.Tag = super;
     lInventoryItem.Name = super.Name;
     lInventoryItem.Description = super.Description;
     lInventoryItem.Quantity = 1;
     lInventoryItem.Texture = this.mSuperTexture;
     return lInventoryItem;
 }