GenerateDataCache.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using FlutterCodeGenerator.Map.Interface;
  2. using FlutterCodeGenerator.ModelTypes;
  3. using System.Collections.Generic;
  4. namespace FlutterCodeGenerator.Model
  5. {
  6. internal class GenerateDataCache
  7. {
  8. private static GenerateDataCache _instance;
  9. private IServiceMap _currentServiceMap;
  10. public static GenerateDataCache Instance => _instance ?? (_instance = new GenerateDataCache());
  11. public Dictionary<ComplexModelType, string> AlreadyGeneratedList { get; }
  12. public Dictionary<string, Dictionary<ModelType, int>> ConflictModelTypeList { get; }
  13. public GenerateDataCache()
  14. {
  15. AlreadyGeneratedList = new Dictionary<ComplexModelType, string>();
  16. ConflictModelTypeList = new Dictionary<string, Dictionary<ModelType, int>>();
  17. }
  18. public void SetCurrentServiceMap(IServiceMap serviceMap)
  19. {
  20. _currentServiceMap = serviceMap;
  21. }
  22. public IServiceMap GetCurrentServiceMap()
  23. {
  24. return _currentServiceMap;
  25. }
  26. }
  27. }