MappingMergeDriver.cs 985 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. namespace Content.Tools
  3. {
  4. internal static class MappingMergeDriver
  5. {
  6. /// %A: Our file
  7. /// %O: Origin (common, base) file
  8. /// %B: Other file
  9. /// %P: Actual filename of the resulting file
  10. public static void Main(string[] args)
  11. {
  12. var ours = new Map(args[0]);
  13. var based = new Map(args[1]); // On what?
  14. var other = new Map(args[2]);
  15. if (ours.GridsNode.Children.Count != 1 || based.GridsNode.Children.Count != 1 || other.GridsNode.Children.Count != 1)
  16. {
  17. Console.WriteLine("one or more files had an amount of grids not equal to 1");
  18. Environment.Exit(1);
  19. }
  20. if (!(new Merger(ours, based, other).Merge()))
  21. {
  22. Console.WriteLine("unable to merge!");
  23. Environment.Exit(1);
  24. }
  25. ours.Save();
  26. Environment.Exit(0);
  27. }
  28. }
  29. }