Пример #1
0
        public static void HiveUpdate(apiBeeHive hive)
        {
            if (!hive.IsCheckable)
            {
                return;
            }

            //make sure it is time for update
            if (DateTime.UtcNow < hive.NextCheck)
            {
                //m_GrowthIndicator = PlantGrowthIndicator.Delay;
                return;
            }

            hive.NextCheck  = DateTime.UtcNow + CheckDelay; //update check timer
            hive.LastGrowth = HiveGrowthIndicator.None;     //reset growth indicator

            hive.HiveAge++;                                 //update age of the hive
            hive.FindFlowersInRange();                      //update flowers
            hive.FindWaterInRange();                        //update water

            //apply any potions
            hive.ApplyBenefitEffects();

            //apply negative effects
            if (!hive.ApplyMaladiesEffects())               //Dead
            {
                return;
            }

            //update stage
            hive.Grow();

            //update maladies
            hive.UpdateMaladies();

            hive.BeeHiveComponent.InvalidateProperties();             //to refresh beehive properties
        }
Пример #2
0
		public static void HiveUpdate(apiBeeHive hive)
		{
			if ( !hive.IsCheckable )
				return;

			//make sure it is time for update
			if ( DateTime.Now < hive.NextCheck )
			{
				//m_GrowthIndicator = PlantGrowthIndicator.Delay;
				return;
			}

			hive.NextCheck = DateTime.Now + CheckDelay; //update check timer
			hive.LastGrowth = HiveGrowthIndicator.None; //reset growth indicator
			
			hive.HiveAge++;	//update age of the hive
			hive.FindFlowersInRange(); //update flowers
			hive.FindWaterInRange();   //update water

			//apply any potions
			hive.ApplyBenefitEffects();
			
			//apply negative effects
			if( !hive.ApplyMaladiesEffects() )  //Dead
				return;

            //update stage
			hive.Grow();
			
			//update maladies
			hive.UpdateMaladies();

			hive.BeeHiveComponent.InvalidateProperties(); //to refresh beehive properties
		}