CoreAttribute.cs 683 B

1234567891011121314151617181920212223242526272829
  1. using System.IO;
  2. namespace InABox.Core
  3. {
  4. [Caption("Attributes")]
  5. public class CoreAttribute : BaseObject, ISequenceable, IPackable
  6. {
  7. public string Name { get; set; } = "";
  8. public string Value { get; set; } = "";
  9. public void Pack(BinaryWriter writer)
  10. {
  11. writer.Write(Sequence);
  12. writer.Write(Name);
  13. writer.Write(Value);
  14. }
  15. public void Unpack(BinaryReader reader)
  16. {
  17. Sequence = reader.ReadInt64();
  18. Name = reader.ReadString();
  19. Value = reader.ReadString();
  20. }
  21. [NullEditor]
  22. public long Sequence { get; set; } = 0;
  23. }
  24. }