internal override void WriteFields(IFormWriter writer)
        {
            if (string.IsNullOrEmpty(this._EditorId) == false)
            {
                writer.WriteString((uint)FieldType.EDID, this._EditorId);
            }

            if (this._FullName.IsEmpty == false)
            {
                writer.WriteLocalizedString((uint)FieldType.FULL, this._FullName);
            }

            if (this._Description.IsEmpty == false)
            {
                writer.WriteLocalizedString((uint)FieldType.DESC, this._Description);
            }

            if (this._KeywordIds.Count == 1)
            {
                writer.WriteValueU32((uint)FieldType.MNAM, this._KeywordIds[0]);
            }

            if (this._Data != null)
            {
                writer.WriteObject((uint)FieldType.DATA, this._Data);
            }
        }
        internal override void WriteFields(IFormWriter writer)
        {
            if (string.IsNullOrEmpty(this._EditorId) == false)
            {
                writer.WriteString((uint)FieldType.EDID, this._EditorId);
            }

            if (this._FullName.IsEmpty == false)
            {
                writer.WriteLocalizedString((uint)FieldType.FULL, this._FullName);
            }

            foreach (var id in this._Ids)
            {
                writer.WriteValueU32((uint)FieldType.LNAM, id);
            }
        }
Exemple #3
0
        internal override void WriteFields(IFormWriter writer)
        {
            if (string.IsNullOrEmpty(this._EditorId) == false)
            {
                writer.WriteString((uint)FieldType.EDID, this._EditorId);
            }

            for (int i = 0; i < Math.Max(this._BaseNames.Count, this._SwapNames.Count); i++)
            {
                if (i < this._BaseNames.Count)
                {
                    writer.WriteString((uint)FieldType.BNAM, this._BaseNames[i], 260);
                }

                if (i < this._SwapNames.Count)
                {
                    writer.WriteString((uint)FieldType.SNAM, this._SwapNames[i], 260);
                }
            }
        }
        internal override void WriteFields(IFormWriter writer)
        {
            if (this._Header != null)
            {
                writer.WriteObject((uint)Fields.HEDR, this._Header);
            }

            if (string.IsNullOrEmpty(this._Creator) == false)
            {
                writer.WriteString((uint)Fields.CNAM, this._Creator);
            }

            if (string.IsNullOrEmpty(this._Summary) == false)
            {
                writer.WriteString((uint)Fields.SNAM, this._Summary);
            }

            foreach (var master in this._Masters)
            {
                writer.WriteString((uint)Fields.MAST, master, 260);
                writer.WriteValueU64((uint)Fields.DATA, 0); // is this necessary?
            }
        }
 internal abstract void WriteFields(IFormWriter writer);
Exemple #6
0
 internal void WriteFields(IFormWriter writer)
 {
     throw new NotImplementedException();
 }
        internal override void WriteFields(IFormWriter writer)
        {
            if (string.IsNullOrEmpty(this._EditorId) == false)
            {
                writer.WriteString((uint)FieldType.EDID, this._EditorId);
            }

            if (this._Description.IsEmpty == false)
            {
                writer.WriteLocalizedString((uint)FieldType.DESC, this._Description);
            }

            if (this._Ingredients.Count > 0)
            {
                writer.WriteData(
                    (uint)FieldType.FVPA,
                    w =>
                {
                    foreach (var ingredient in this._Ingredients)
                    {
                        w.WriteValueU32(ingredient.InputId);
                        w.WriteValueS32(ingredient.Quantity);
                    }
                });
            }

            if (this._OutputId != 0)
            {
                writer.WriteValueU32((uint)FieldType.CNAM, this._OutputId);
            }

            if (this._OutputCount != 0)
            {
                writer.WriteValueU32((uint)FieldType.INTV, this._OutputCount);
            }

            if (this._BenchKeywordId != 0)
            {
                writer.WriteValueU32((uint)FieldType.BNAM, this._BenchKeywordId);
            }

            if (this._FilterKeywordIds.Count > 0)
            {
                writer.WriteData(
                    (uint)FieldType.FNAM,
                    w =>
                {
                    foreach (var id in this._FilterKeywordIds)
                    {
                        w.WriteValueU32(id);
                    }
                });
            }

            if (this._PickupSoundId != 0)
            {
                writer.WriteValueU32((uint)FieldType.YNAM, this._PickupSoundId);
            }

            if (this._PutdownSoundId != 0)
            {
                writer.WriteValueU32((uint)FieldType.ZNAM, this._PutdownSoundId);
            }

            if (this._ArtId != 0)
            {
                writer.WriteValueU32((uint)FieldType.ANAM, this._ArtId);
            }
        }