示例#1
0
 public PlayerInfo()
 {
     WeaponBags      = new PlayerWeaponBagData[PlayerWeaponBagCount];
     AvatarIds       = new List <int>();
     WeaponAvatarIds = new List <int>();
     SprayLacquers   = new List <int>();
 }
示例#2
0
        public PlayerInfo(string token, IRoomId roomId, long playerId, string playerName, int roleModelId, long teamId,
                          int num, int level, int backId, int titleId, int badgeId, int[] avatarIds, int[] weaponAvatarIds,
                          int[] sprayLacquers, bool hasTestWeapon, int jobAttrbute, CampInfo campInfo) : this()
        {
            Token       = token;
            RoomId      = roomId;
            PlayerId    = playerId;
            PlayerName  = playerName;
            RoleModelId = roleModelId;
            TeamId      = teamId;
            Num         = num;
            Level       = level;
            BackId      = backId;
            TitleId     = titleId;
            BadgeId     = badgeId;

            if (avatarIds != null)
            {
                AvatarIds.AddRange(avatarIds);
            }


            if (weaponAvatarIds != null)
            {
                WeaponAvatarIds.AddRange(weaponAvatarIds);
            }

            if (sprayLacquers != null)
            {
                SprayLacquers.AddRange(sprayLacquers);
            }

            if (hasTestWeapon)
            {
                WeaponBags[1] = new PlayerWeaponBagData
                {
                    BagIndex   = 1,
                    weaponList = new List <PlayerWeaponData>
                    {
                        new PlayerWeaponData
                        {
                            Index             = 1,
                            WeaponTplId       = 1,
                            WeaponAvatarTplId = 1,
                        }
                    }
                };
            }

            JobAttribute = jobAttrbute;
            CampInfo     = campInfo;
        }
示例#3
0
 public void CopyTo(PlayerWeaponBagData playerWeaponBagData)
 {
     if (null == playerWeaponBagData)
     {
         Logger.Error("Target to copy is null");
         return;
     }
     playerWeaponBagData.BagIndex = BagIndex;
     if (playerWeaponBagData.weaponList == null)
     {
         playerWeaponBagData.weaponList = new List <PlayerWeaponData>();
     }
     playerWeaponBagData.weaponList.Clear();
     foreach (var weapon in weaponList)
     {
         playerWeaponBagData.weaponList.Add(weapon);
     }
 }