Пример #1
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncInventory.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateItem tmpl;

                if (DataManager.dictItem.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SItem sItem = new SItem(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldSlot, i), data.GetLongAsInt(DatabaseManager.fieldAmount, i), data.GetLongAsInt(DatabaseManager.fieldAmmo, i), data.GetLongAsInt(DatabaseManager.fieldCharges, i), data.GetLongAsInt(DatabaseManager.fieldLevel, i));
                    syncInventory.Add(sItem);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }
Пример #2
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncAttributes.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateAttribute tmpl;

                if (DataManager.dictAttribute.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SAttribute sAttribute = new SAttribute(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldValue, i));
                    syncAttributes.Add(sAttribute);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }
Пример #3
0
        // -------------------------------------------------------------------------------
        // Load
        // -------------------------------------------------------------------------------
        public override void Load(BaseDataTable data)
        {
            syncStatus.Clear();

            for (int i = 0; i < data.Rows.Count; ++i)
            {
                TemplateStatus tmpl;

                if (DataManager.dictStatus.TryGetValue(data.GetIdHash(i), out tmpl))
                {
                    SStatus sStatus = new SStatus(tmpl.GetId, data.GetLongAsInt(DatabaseManager.fieldLevel, i), data.GetDouble(DatabaseManager.fieldDuration, i));
                    syncStatus.Add(sStatus);
                }
                else
                {
                    Debug.LogWarning("Skipped template '" + data.GetString(DatabaseManager.fieldName) + "' as it was not found in Library.");
                }
            }

            data.Cleanup();
        }