Exemplo n.º 1
0
        public override int GetHashCode()
        {
            int num = 1;

            if (Id != 0)
            {
                num ^= Id.GetHashCode();
            }
            if (cmdCase_ == CmdOneofCase.GiveAllCompanions)
            {
                num ^= GiveAllCompanions.GetHashCode();
            }
            if (cmdCase_ == CmdOneofCase.GiveAllWeapons)
            {
                num ^= GiveAllWeapons.GetHashCode();
            }
            if (cmdCase_ == CmdOneofCase.SetWeaponLevel)
            {
                num ^= SetWeaponLevel.GetHashCode();
            }
            if (cmdCase_ == CmdOneofCase.SetAllWeaponLevels)
            {
                num ^= SetAllWeaponLevels.GetHashCode();
            }
            if (cmdCase_ == CmdOneofCase.SetGender)
            {
                num ^= SetGender.GetHashCode();
            }
            num ^= (int)cmdCase_;
            if (_unknownFields != null)
            {
                num ^= ((object)_unknownFields).GetHashCode();
            }
            return(num);
        }
Exemplo n.º 2
0
        public void MergeFrom(AdminCmd other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Id != 0)
            {
                Id = other.Id;
            }
            switch (other.CmdCase)
            {
            case CmdOneofCase.GiveAllCompanions:
                GiveAllCompanions = other.GiveAllCompanions;
                break;

            case CmdOneofCase.GiveAllWeapons:
                GiveAllWeapons = other.GiveAllWeapons;
                break;

            case CmdOneofCase.SetWeaponLevel:
                if (SetWeaponLevel == null)
                {
                    SetWeaponLevel = new Types.SetLevel();
                }
                SetWeaponLevel.MergeFrom(other.SetWeaponLevel);
                break;

            case CmdOneofCase.SetAllWeaponLevels:
                if (SetAllWeaponLevels == null)
                {
                    SetAllWeaponLevels = new Types.SetAllLevels();
                }
                SetAllWeaponLevels.MergeFrom(other.SetAllWeaponLevels);
                break;

            case CmdOneofCase.SetGender:
                if (SetGender == null)
                {
                    SetGender = new Types.SetGender();
                }
                SetGender.MergeFrom(other.SetGender);
                break;
            }
            _unknownFields = UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }