public PlayerSelect(PlayerSelectType type, PlayerProfile profile) { if (type == PlayerSelectType.Profile) { if (profile == null) { throw new ArgumentNullException(nameof(profile), "profile cannot be null when type = Profile"); } m_type = PlayerSelectType.Profile; m_profile = profile; } else if (type == PlayerSelectType.Random) { if (profile != null) { throw new ArgumentException("profile must be null when type = Random", nameof(profile)); } m_type = PlayerSelectType.Random; m_profile = null; } }
public PlayerSelect(PlayerSelectType type, PlayerProfile profile) { if (type == PlayerSelectType.Profile) { if (profile == null) throw new ArgumentNullException("profile", "profile cannot be null when type = Profile"); m_type = PlayerSelectType.Profile; m_profile = profile; } else if (type == PlayerSelectType.Random) { if (profile != null) throw new ArgumentException("profile must be null when type = Random", "profile"); m_type = PlayerSelectType.Random; m_profile = null; } }