/// <summary>
        /// Swaps the BattleIndex and BattlePosition of two BattleEntities.
        /// <para>This is intended for BattleEntities of the same EntityType.
        /// Swapping BattleEntities of different EntityTypes may produce undesirable behavior.</para>
        /// </summary>
        /// <param name="firstEntity">The first BattleEntity to swap.</param>
        /// <param name="secondEntity">The second BattleEntity to swap.</param>
        /// <param name="preserveHeight">Whether to preserve the height of each BattleEntity or not.
        /// If true, BattleEntities will only swap X values of their BattlePositions.</param>
        public static void SwapEntityBattlePosAndIndex(BattleEntity firstEntity, BattleEntity secondEntity, bool preserveHeight)
        {
            //Store values
            Vector2 firstBattlePosition  = firstEntity.BattlePosition;
            Vector2 secondBattlePosition = secondEntity.BattlePosition;

            int firstBattleIndex  = firstEntity.BattleIndex;
            int secondBattleIndex = secondEntity.BattleIndex;

            //Swap positions
            //If we preserve height, use the BattleEntity's own Y
            if (preserveHeight == true)
            {
                firstEntity.SetBattlePosition(new Vector2(secondBattlePosition.X, firstBattlePosition.Y));
                secondEntity.SetBattlePosition(new Vector2(firstBattlePosition.X, secondBattlePosition.Y));
            }
            else
            {
                firstEntity.SetBattlePosition(secondBattlePosition);
                secondEntity.SetBattlePosition(firstBattlePosition);
            }

            //Swap BattleIndex; the lists will be automatically sorted
            firstEntity.SetBattleIndex(secondBattleIndex, true);
            secondEntity.SetBattleIndex(firstBattleIndex, true);
        }