private PositionStart *GetStartPositionForStage(StageBase stage, Team team)
        {
            if (State.IsMultiplayerMode())
            {
                // Bug: Setting the same team multiple times will always use start position of first player to use that team.
                // This bug is inherited from the game, because the game only uses the team parameter to determine
                // spawn location, assuming players are separate teams.
                // If one player uses a team used by an earlier player, they will get earlier player's spawn.

                // Support 4 players.
                int playerNumber = 0;
                for (; playerNumber <= 3; playerNumber++)
                {
                    if (Player.TeamTop[playerNumber].AsReference().Team == team)
                    {
                        break;
                    }
                }

                // If all numbers fail, use P1's spawn
                if (playerNumber == 4)
                {
                    playerNumber = 1;
                }

                // Get spawn position.
                return(&stage.StartPositions[playerNumber]);
            }

            return(&stage.StartPositions[(int)team]);
        }
 /* Autoimplemented by R# */
 protected bool Equals(StageBase other)
 {
     return(StageId == other.StageId &&
            StartPositions == other.StartPositions &&
            EndPositions == other.EndPositions &&
            BragPositions == other.BragPositions &&
            Splines == other.Splines);
 }
        /// <summary>
        /// Attempts to obtain a <see cref="StageBase"/> object from this class' collection for the current stage.
        /// </summary>
        private bool TryGetCurrentStage(out StageBase stage)
        {
            for (int x = _allStages.Count - 1; x >= 0; x--)
            {
                var currentStage = _allStages[x];
                if (currentStage.StageId == State.CurrentStage)
                {
                    stage = currentStage;
                    return(true);
                }
            }

            stage = null;
            return(false);
        }