internal static void BackButtonFunction()
 {
     AudioController.ButtonClick3SoundEffectInstance.Play();
     HeroActionGroupState = HeroActionButtonGroupState.HERO_ACTION;
     SelectedStructureType = ObjectType.NULL;
     RallyTargetState = RallyFetchTarget.INACTIVE;
 }
 internal static void BlueRallyButtonFunction()
 {
     AudioController.ButtonClick3SoundEffectInstance.Play();
     RallyTargetState = RallyFetchTarget.ACTIVE;
     objectColor = ObjectColor.BLUE;
 }
        internal static void ListenForRallyPoint()
        {
            if (RallyTargetState == RallyFetchTarget.ACTIVE && GameController.PlayingField.Contains(mouseRectangle))
            {

                switch (objectColor)
                {
                    case ObjectColor.BLUE:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {

                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.BLUE)
                                {

                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }

                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[0] != null)
                            GameController.InPlayStructures[0].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);
                        break;

                    case ObjectColor.GREEN:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.GREEN)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[3] != null)
                            GameController.InPlayStructures[3].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    case ObjectColor.PURPLE:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.PURPLE)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[4] != null)
                            GameController.InPlayStructures[4].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    case ObjectColor.RED:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.RED)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[1] != null)
                            GameController.InPlayStructures[1].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    case ObjectColor.YELLOW:

                        GameObject.mPotentialTargetListList.Reset();
                        for (int i = 0; i < GameObject.mPotentialTargetListList.GetCount(); i++)
                        {
                            if (GameObject.mPotentialTargetListList.GetCurrent().gameObject.Hostility == Hostility.FRIENDLY &&
                                !(GameObject.mPotentialTargetListList.GetCurrent().gameObject is Hero))
                            {
                                Friendly temp = (Friendly)GameObject.mPotentialTargetListList.GetCurrent().gameObject;

                                if (temp.Color == ObjectColor.YELLOW)
                                {
                                    temp.DefaultTarget = new Vector2(mouseState.X, mouseState.Y);
                                }
                            }
                            GameObject.mPotentialTargetListList.NextNode();
                        }
                        if (GameController.InPlayStructures[2] != null)
                            GameController.InPlayStructures[2].StructureAttribute.DefaultUnitTarget = new Vector2(mouseState.X, mouseState.Y);

                        break;

                    default:
                        break;
                }

                RallyTargetState = RallyFetchTarget.INACTIVE;
                objectColor = ObjectColor.NULL;
                HeroActionGroupState = HeroActionButtonGroupState.HERO_ACTION;

            }
        }