You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

LLamaPos.cs 698 B

1234567891011121314151617181920212223242526
  1. namespace LLama.Native;
  2. /// <summary>
  3. /// Indicates position in a sequence
  4. /// </summary>
  5. public readonly record struct LLamaPos(int Value)
  6. {
  7. /// <summary>
  8. /// The raw value
  9. /// </summary>
  10. public readonly int Value = Value;
  11. /// <summary>
  12. /// Convert a LLamaPos into an integer (extract the raw value)
  13. /// </summary>
  14. /// <param name="pos"></param>
  15. /// <returns></returns>
  16. public static explicit operator int(LLamaPos pos) => pos.Value;
  17. /// <summary>
  18. /// Convert an integer into a LLamaPos
  19. /// </summary>
  20. /// <param name="value"></param>
  21. /// <returns></returns>
  22. public static implicit operator LLamaPos(int value) => new(value);
  23. }