Example #1
0
        private int GetRandomWingIndex(BeeEnvironmentEnum beeEnvironment)
        {
            int totalWingsFrames = _beeWingsMovementInvoker.GetTotalBeeAmimationWingFrames(beeEnvironment);
            int randomWingIndex  = rand.Next(0, totalWingsFrames);

            return(randomWingIndex);
        }
Example #2
0
        public BeeWingMovementCycle GetBeeSelectedWingAnimation(int index, BeeEnvironmentEnum beeEnvironment)
        {
            var selectedWings     = GetBeeWingsMovementCycles(beeEnvironment);
            var selectedWingImage = selectedWings[index];

            return(selectedWingImage);
        }
Example #3
0
        public BeeEnvironmentBehaviorEnum SelectBehaviorRandomly(BeeEnvironmentEnum beeEnvironment)
        {
            var environment       = beeEnvironment.ToString().ToLower();
            var allBehaviors      = Enum.GetValues(typeof(BeeEnvironmentBehaviorEnum)).Cast <BeeEnvironmentBehaviorEnum>().ToList();
            var selectedBehaviors = allBehaviors.Where(a => a.ToString().ToLower().Contains(environment)).ToList();
            var index             = rand.Next(0, selectedBehaviors.Count);
            BeeEnvironmentBehaviorEnum selectedBehavior = selectedBehaviors[index];

            return(selectedBehavior);
        }
Example #4
0
        public IBee SetNextBeeWingMovementCycle(IBee bee, BeeEnvironmentEnum beeEnvironment)
        {
            var nextIndex = bee.BeeIndexWingAnimation + 1;

            if (nextIndex == _beeWingsMovementInvoker.GetTotalBeeAmimationWingFrames(beeEnvironment))
            {
                nextIndex = 0;
            }
            BeeWingMovementCycle nextBeeWingMovement = _beeWingsMovementInvoker.GetBeeSelectedWingAnimation(nextIndex, beeEnvironment);

            bee.BeeIndexWingAnimation = nextBeeWingMovement.BeeWingMovementIndex;
            if (_beeCommon.BeeIsIndoors(bee.BeeEnvironmentBehavior))
            {
                bee.BeeIndoorsWingAnimationImage = nextBeeWingMovement.BeeWingMovementImage;
            }
            if (_beeCommon.BeeIsInOuterWorld(bee.BeeEnvironmentBehavior))
            {
                bee.BeeOuterWorldWingAnimationImage = nextBeeWingMovement.BeeWingMovementImage;
            }
            return(bee);
        }
Example #5
0
        private List <BeeWingMovementCycle> GetBeeWingsMovementCycles(BeeEnvironmentEnum beeEnvironment)
        {
            var selectedWingMovementCycle = beeWingsInEnvironments.Where(a => a.BeeEnvironmentType == beeEnvironment).FirstOrDefault();

            return(selectedWingMovementCycle.BeeWings);
        }
Example #6
0
        public int GetTotalBeeAmimationWingFrames(BeeEnvironmentEnum beeEnvironment)
        {
            var allWings = GetBeeWingsMovementCycles(beeEnvironment);

            return(allWings.Count);
        }