Example #1
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;
        }
Example #2
0
        public void CopyFrom(object rightComponent)
        {
            var right = (rightComponent as PlayerInfoComponent);

            if (right == null)
            {
                return;
            }
            PlayerId    = right.PlayerId;
            PlayerName  = right.PlayerName;
            RoleModelId = right.RoleModelId;
            TeamId      = right.TeamId;
            Num         = right.Num;
            Level       = right.Level;
            BackId      = right.BackId;
            TitleId     = right.TitleId;
            BadgeId     = right.BadgeId;

            if (AvatarIds == null)
            {
                AvatarIds = new List <int>();
            }
            AvatarIds.Clear();
            AvatarIds.AddRange(right.AvatarIds);
            if (WeaponAvatarIds == null)
            {
                WeaponAvatarIds = new List <int>();
            }
            WeaponAvatarIds.Clear();
            WeaponAvatarIds.AddRange(right.WeaponAvatarIds);

            if (SprayLacquers == null)
            {
                SprayLacquers = new List <int>();
            }
            SprayLacquers.Clear();
            SprayLacquers.AddRange(right.SprayLacquers);

            Camp         = right.Camp;
            JobAttribute = right.JobAttribute;
            Token        = right.Token;
            InitPosition = right.InitPosition;
        }