RecipePageRegistry.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using GadgetCore.API;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. namespace VendingMachine.RecipePageRegistry
  7. {
  8. /// <summary>
  9. /// This registry is filled with ChipInfos, and is used for registering custom chips to the game.
  10. /// </summary>
  11. public class RecipePageRegistry : Registry<RecipePageRegistry, RecipePageInfo, RecipePageType>
  12. {
  13. private static Dictionary<string, int> chipIDsByName;
  14. private static Dictionary<string, int> chipIDsByRegistryName;
  15. /// <summary>
  16. /// The name of this registry.
  17. /// </summary>
  18. public const string REGISTRY_NAME = "RecipePage";
  19. /// <summary>
  20. /// Gets the name of this registry. Must be constant. Returns <see cref="REGISTRY_NAME"/>.
  21. /// </summary>
  22. public override string GetRegistryName()
  23. {
  24. return REGISTRY_NAME;
  25. }
  26. /// <summary>
  27. /// Called after the specified Registry Entry has been registered. You should never call this yourself. Note that this is called before <see cref="RegistryEntry{E, T}.PostRegister"/>
  28. /// </summary>
  29. protected override void PostRegistration(RecipePageInfo entry)
  30. {
  31. //chipIDsByRegistryName[entry.RegistryName] = entry.ID;
  32. }
  33. /// <summary>
  34. /// Called just before an entry is removed from the registry by <see cref="Registry.UnregisterGadget(GadgetInfo)"/>
  35. /// </summary>
  36. protected override void OnUnregister(RecipePageInfo entry)
  37. {
  38. //chipIDsByName.Remove(entry.Name);
  39. //chipIDsByRegistryName.Remove(entry.RegistryName);
  40. }
  41. }
  42. /// <summary>
  43. /// Specifies what type of recipe this is.
  44. /// </summary>
  45. public enum RecipePageType
  46. {
  47. /// <summary>
  48. /// This recipe is avalible at the Gear Forge.
  49. /// </summary>
  50. GearForge,
  51. /// <summary>
  52. /// This recipe is avalible at the Alchemy Station.
  53. /// </summary>
  54. AlchemyStation,
  55. /// <summary>
  56. /// This recipe is avalible at the Ultimate Forge.
  57. /// </summary>
  58. UltimateForge
  59. }
  60. }