RecipePageEntry.cs 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. using System;
  2. namespace RecipeMenuCore.API
  3. {
  4. public class RecipePageEntry
  5. {
  6. /// <summary>
  7. /// The ultimate items in UltimateFore recipes or the inputs in other recipes.
  8. /// </summary>
  9. [Obsolete]
  10. public int[] ItemIdExtension
  11. {
  12. get
  13. {
  14. if (ItemIds != null && ItemIds.Length == 4)
  15. return new int[] { ItemIds[0], ItemIds[1], ItemIds[2] };
  16. return new int[3];
  17. }
  18. }
  19. /// <summary>
  20. /// The normal item in UltimateFore recipes or the output in other recipes.
  21. /// </summary>
  22. [Obsolete]
  23. public int ItemIdBase
  24. {
  25. get
  26. {
  27. if (ItemIds != null && ItemIds.Length == 4)
  28. return ItemIds[3];
  29. return 0;
  30. }
  31. }
  32. /// <summary>
  33. /// The MinAmount of items created from a recipe.
  34. /// </summary>
  35. [Obsolete]
  36. public int MinAmount
  37. {
  38. get
  39. {
  40. if (MinAmounts != null && MinAmounts.Length == 4)
  41. return MinAmounts[3];
  42. return 1;
  43. }
  44. }
  45. /// <summary>
  46. /// The MaxBonusAmount to be added to the base value.
  47. /// </summary>
  48. [Obsolete]
  49. public int MaxBonusAmount
  50. {
  51. get
  52. {
  53. if (MaxBonusAmounts != null && MaxBonusAmounts.Length == 4)
  54. return MaxBonusAmounts[3];
  55. return 0;
  56. }
  57. }
  58. /// <summary>
  59. /// Should the input be visible, if the craft has never been done before.
  60. /// </summary>
  61. public bool AllwaysShowInput { get; protected set; }
  62. /// <summary>
  63. /// All 4 items used in the recipe.
  64. /// </summary>
  65. public int[] ItemIds { get; protected set; }
  66. /// <summary>
  67. /// The Minimum amount of items required or created of each of the 4 items.
  68. /// </summary>
  69. public int[] MinAmounts { get; protected set; }
  70. /// <summary>
  71. /// The MaxBonusAmount to be added to the base value (output only).
  72. /// </summary>
  73. public int[] MaxBonusAmounts { get; protected set; }
  74. /// <summary>
  75. /// States if the recipe is a 3 to 1 or a 1 to 3 items recipe.
  76. /// </summary>
  77. public bool IsReverse { get; protected set; }
  78. /// <summary>
  79. /// Use to create a new RecipePageEntry.
  80. /// </summary>
  81. /// <param name="id1">The first ultimate item in UltimateFore recipes or the first input in other recipes.</param>
  82. /// <param name="id2">The second ultimate item in UltimateFore recipes or the second input in other recipes.</param>
  83. /// <param name="id3">The third ultimate item in UltimateFore recipes or the third input in other recipes.</param>
  84. /// <param name="idBase">The normal item in UltimateFore recipes or the output in other recipes.</param>
  85. public RecipePageEntry(int id1, int id2, int id3, int idBase)
  86. {
  87. ItemIds = new int[] { id1, id2, id3, idBase };
  88. MinAmounts = new int[] { 1, 1, 1, 1 };
  89. MaxBonusAmounts = new int[] { 0, 0, 0, 0 };
  90. AllwaysShowInput = false;
  91. }
  92. /// <summary>
  93. /// Use to create a new RecipePageEntry.
  94. /// </summary>
  95. /// <param name="id1">The first ultimate item in UltimateFore recipes or the first input in other recipes.</param>
  96. /// <param name="id2">The second ultimate item in UltimateFore recipes or the second input in other recipes.</param>
  97. /// <param name="id3">The third ultimate item in UltimateFore recipes or the third input in other recipes.</param>
  98. /// <param name="idBase">The normal item in UltimateFore recipes or the output in other recipes.</param>
  99. /// <param name="min">The minimum amount of items created from a recipe.</param>
  100. /// <param name="maxBonus">The maximum bonus amount of items created from a recipe.</param>
  101. public RecipePageEntry(int id1, int id2, int id3, int idBase, int min, int maxBonus)
  102. {
  103. ItemIds = new int[] { id1, id2, id3, idBase };
  104. MinAmounts = new int[] { 1, 1, 1, min };
  105. MaxBonusAmounts = new int[] { 0, 0, 0, maxBonus };
  106. }
  107. /// <summary>
  108. /// Use to create a new RecipePageEntry.
  109. /// </summary>
  110. /// <param name="id1">The first ultimate item in UltimateFore recipes or the first input in other recipes.</param>
  111. /// <param name="id2">The second ultimate item in UltimateFore recipes or the second input in other recipes.</param>
  112. /// <param name="id3">The third ultimate item in UltimateFore recipes or the third input in other recipes.</param>
  113. /// <param name="idBase">The normal item in UltimateFore recipes or the output in other recipes.</param>
  114. /// <param name="min">The minimum amount of items created from a recipe.</param>
  115. /// <param name="maxBonus">The maximum bonus amount of items created from a recipe.</param>
  116. public RecipePageEntry(int id1, int id2, int id3, int idBase, int min, int maxBonus, bool allwaysShowInput)
  117. {
  118. ItemIds = new int[] { id1, id2, id3, idBase };
  119. MinAmounts = new int[] { 1, 1, 1, min };
  120. MaxBonusAmounts = new int[] { 0, 0, 0, maxBonus };
  121. AllwaysShowInput = allwaysShowInput;
  122. }
  123. /// <summary>
  124. /// Use to create a new RecipePageEntry.
  125. /// </summary>
  126. /// <param name="idIn">The input item id.</param>
  127. /// <param name="idOut1">The first output item id.</param>
  128. /// <param name="idOut2">The second output item id.</param>
  129. /// <param name="idOut3">The third output item id.</param>
  130. public RecipePageEntry(int idIn, int idOut1, int idOut2, int idOut3, int minOut1, int minOut2, int minOut3, int maxBonusOut1, int maxBonusOut2, int maxBonusOut3)
  131. {
  132. ItemIds = new int[] { idIn, idOut1, idOut2, idOut3 };
  133. MinAmounts = new int[] { 1, minOut1, minOut2, minOut3 };
  134. MaxBonusAmounts = new int[] { 0, maxBonusOut1, maxBonusOut2, maxBonusOut3 };
  135. IsReverse = true;
  136. }
  137. }
  138. }