Kernel_bin.Slot_array.cs 964 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. using System.IO;
  3. namespace OpenVIII
  4. {
  5. public partial class Kernel_bin
  6. {
  7. /// <summary>
  8. /// Slot Array Data
  9. /// </summary>
  10. /// <see cref="https://github.com/alexfilth/doomtrain/wiki/Slot-array"/>
  11. public class Slot_array
  12. {
  13. public const int count = 60;
  14. public const int id = 26;
  15. public const int size = 1;
  16. public byte SlotID { get; private set; }
  17. public void Read(BinaryReader br, int i) => SlotID = br.ReadByte();
  18. public static List<Slot_array> Read(BinaryReader br)
  19. {
  20. var ret = new List<Slot_array>(count);
  21. for (int i = 0; i < count; i++)
  22. {
  23. var tmp = new Slot_array();
  24. tmp.Read(br, i);
  25. ret.Add(tmp);
  26. }
  27. return ret;
  28. }
  29. }
  30. }
  31. }