Пример #1
0
        public void FromObjectArray(object[] properties)
        {
            int i = 0;

            PlayerID    = (string)properties[i++];
            Name        = (string)properties[i++];
            IsRejoining = bool.Parse(properties[i++] as string);

            object[] serializedWeapon = properties[i++] as object[];
            if (serializedWeapon.Length > 0)
            {
                EquippedWeaponItemModel = new EquipmentItemModel();
                EquippedWeaponItemModel.FromObjectArray(serializedWeapon);
            }

            object[] serializedOffhand = properties[i++] as object[];
            if (serializedOffhand.Length > 0)
            {
                EquippedOffHandItemModel = new EquipmentItemModel();
                EquippedOffHandItemModel.FromObjectArray(serializedOffhand);
            }

            object[] serializedArmor = properties[i++] as object[];
            if (serializedArmor.Length > 0)
            {
                EquippedArmorItemModel = new EquipmentItemModel();
                EquippedArmorItemModel.FromObjectArray(serializedArmor);
            }

            CombatantModel = new CombatantModel();
            CombatantModel.FromObjectArray(properties[i] as object[]);
        }
Пример #2
0
        public void FromObjectArray(object[] properties)
        {
            int i = 0;

            ID             = properties[i++] as string;
            Name           = properties[i++] as string;
            NpcRole        = (NpcRole)properties[i++];
            NpcRace        = (NpcRace)properties[i++];
            NpcSize        = (NpcSize)properties[i++];
            RarityType     = (RarityType)properties[i++];
            CombatantModel = new CombatantModel();
            CombatantModel.FromObjectArray(properties[i++] as object[]);

            object[] alwaysDroppedItemIdObjects = properties[i++] as object[];
            AlwaysDroppedItemIDs = new string[alwaysDroppedItemIdObjects.Length];
            for (int j = 0; j < AlwaysDroppedItemIDs.Length; j++)
            {
                AlwaysDroppedItemIDs[j] = alwaysDroppedItemIdObjects[j] as string;
            }
        }