Example #1
0
        public IBee UpdateBeeInfo_OnTargetedMovement(IBee bee)
        {   //Indoors
            if (_beeCommon.BeeIsIndoors(bee.BeeEnvironmentBehavior))
            {
                SetBeeTargetedMovementDirection_Indoors(bee, _beehiveExitDoorDimmensions);
                SetBeeNewBehaviorOnHittingTarget_Indoors(bee, _beehiveExitDoorDimmensions);
            }

            //OuterWorld
            if (BeeIsGoingTowardsBeehiveEntrance(bee))
            {
                Rectangle beehiveEntranceDoor = _landscapeManager.GetBeehiveEntranceDoorDimmensions();
                SetBeeTargetedMovementDirection_OuterWorld(bee, beehiveEntranceDoor);
                SetBeeNewTargetedBehaviorOnHittingTarget_OuterWorld(bee, beehiveEntranceDoor);
            }

            if (BeeIsGoingTowardsFlower(bee))
            {
                SetTargetBehaviorBee_PollenFlower(bee);
                if (!HasAFlowerIDBeenAssignedToBee(bee))
                {
                    SetRandomBehaviorBee_OuterWorld(bee);
                }
                else
                {
                    IFlower selectedFlower = GetSelectedFlowerByID(bee.BeeTargetFlowerID);
                    if (selectedFlower != null)
                    {
                        SetBeeTargetedMovementDirection_OuterWorld(bee, selectedFlower.FlowerPollenArea);
                        SetBeeNewTargetedBehaviorOnHittingTarget_OuterWorld(bee, selectedFlower.FlowerPollenArea);
                    }
                }
            }
            return(bee);
        }
Example #2
0
        public void SetWorldDimmensions(int width, int height)
        {
            _worldWidth            = width;
            _worldHeight           = height;
            _worldBoundariesWidth  = _worldWidth - 40;
            _worldBoundariesHeight = _worldHeight - 60;

            _worldDimmensions           = new Rectangle(_worldInitialPointX, _worldInitialPointY, _worldWidth, _worldHeight);
            _worldBoundariesDimmensions = new Rectangle(_worldBoundariesInitialPointX, _worldBoundariesInitialPointY, _worldBoundariesWidth, _worldBoundariesHeight);
            _landscapeManager.SetLandscapeDimmensions(_worldWidth, _worldHeight);
            _beehiveWorldEntranceDimmensions = _landscapeManager.GetBeehiveEntranceDoorDimmensions();
        }