ScriptResultId.cs 703 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. namespace FF8
  3. {
  4. public struct ScriptResultId
  5. {
  6. public const Int32 MaxIndex = 8;
  7. public Int32 ResultId { get; }
  8. public ScriptResultId(Int32 resultId)
  9. {
  10. if (resultId < 0 || resultId > MaxIndex)
  11. throw new ArgumentOutOfRangeException(nameof(resultId), $"Invalid temporary result variable index: {resultId}");
  12. ResultId = resultId;
  13. }
  14. public override String ToString()
  15. {
  16. return $"ResultId: {ResultId}";
  17. }
  18. public Int32 this[IInteractionService service]
  19. {
  20. get => service[this];
  21. set => service[this] = value;
  22. }
  23. }
  24. }