Example #1
0
        void Build(int UID)
        {
            var _db = new PangyaEntities();

            foreach (var info in _db.ProcGetCharacter(UID))
            {
                var character = new PlayerCharacterData()
                {
                    TypeID      = (uint)info.TYPEID,
                    Index       = (uint)info.CID,
                    HairColour  = (ushort)info.HAIR_COLOR,
                    GiftFlag    = (ushort)info.GIFT_FLAG,
                    Power       = (byte)info.POWER,
                    Control     = (byte)info.CONTROL,
                    Impact      = (byte)info.IMPACT,
                    Spin        = (byte)info.SPIN,
                    Curve       = (byte)info.CURVE,
                    FCutinIndex = (uint)info.CUTIN,
                    NEEDUPDATE  = false,
                    AuxPart     = (uint)info.AuxPart,
                    AuxPart2    = (uint)info.AuxPart2,
                };
                for (int i = 0; i < 24; i++)
                {
                    var valorPropriedade = info.GetType().GetProperty($"PART_TYPEID_{i + 1}").GetValue(info, null);
                    character.EquipTypeID[i] = Convert.ToUInt32(valorPropriedade);
                }

                for (int i = 0; i < 24; i++)
                {
                    var valorPropriedade = info.GetType().GetProperty($"PART_IDX_{i + 1}").GetValue(info, null);
                    character.EquipIndex[i] = Convert.ToUInt32(valorPropriedade);
                }
                Add(character);
            }
        }