LoadConfigHelper.cs 666 B

1234567891011121314151617181920212223
  1. using System.Collections.Generic;
  2. using System.IO;
  3. namespace ET
  4. {
  5. public static class LoadConfigHelper
  6. {
  7. public static void GetAllConfigBytes(Dictionary<string, byte[]> output)
  8. {
  9. foreach (string file in Directory.GetFiles($"../Config", "*.bytes"))
  10. {
  11. string key = Path.GetFileNameWithoutExtension(file);
  12. output[key] = File.ReadAllBytes(file);
  13. }
  14. }
  15. public static byte[] GetOneConfigBytes(string configName)
  16. {
  17. byte[] configBytes = File.ReadAllBytes($"../Config/{configName}.bytes");
  18. return configBytes;
  19. }
  20. }
  21. }