CoreAttribute.cs 814 B

1234567891011121314151617181920212223242526272829303132333435
  1. namespace InABox.Core
  2. {
  3. [Caption("Attributes")]
  4. public class CoreAttribute : BaseObject, ISequenceable, IPackable
  5. {
  6. public string Name { get; set; }
  7. public string Value { get; set; }
  8. public void Pack(FastBinaryWriter writer)
  9. {
  10. writer.Write(Sequence);
  11. writer.Write(Name);
  12. writer.Write(Value);
  13. }
  14. public void Unpack(FastBinaryReader reader)
  15. {
  16. Sequence = reader.ReadInt64();
  17. Name = reader.ReadString();
  18. Value = reader.ReadString();
  19. }
  20. [NullEditor]
  21. public long Sequence { get; set; }
  22. protected override void Init()
  23. {
  24. base.Init();
  25. Sequence = 0;
  26. Name = "";
  27. Value = "";
  28. }
  29. }
  30. }