示例#1
0
        public void AddQueen(QueenBee queenBee, Action queenAddCompleteCallback)
        {
            if (queenBee == null) throw new ArgumentNullException("queenBee");
            if (queenAddCompleteCallback == null) throw new ArgumentNullException("queenAddCompleteCallback");

            this.mQueenBeeToAdd = queenBee;
            this.mQueenAddCompleteCallback = queenAddCompleteCallback;
            this.mQueenAddTicksRemaining = 5;
            this.mIsAddingQueen = true;
        }
示例#2
0
 private InventoryItem ToInventoryItem(QueenBee queenBee)
 {
     var lInventoryItem = new InventoryItem();
     lInventoryItem.Tag = queenBee;
     lInventoryItem.Name = queenBee.Name;
     lInventoryItem.Description = queenBee.Description;
     lInventoryItem.Quantity = 1;
     lInventoryItem.Texture = this.mSuperTexture;
     return lInventoryItem;
 }
示例#3
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);
        }
示例#4
0
 private void AddQueen(QueenBee queenBee)
 {
     this.mBeeHiveManager.AddQueen(queenBee, this.QueenAddComplete);
 }