예제 #1
0
        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;
            }
        }
예제 #2
0
        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;
            }
        }