Class TransformerFinder


  • public class TransformerFinder
    extends java.lang.Object
    • Constructor Detail

      • TransformerFinder

        public TransformerFinder​(GameData globalData,
                                 GameData addedData,
                                 UserInterface ui,
                                 boolean interactive,
                                 boolean tryFindingBoxes)
    • Method Detail

      • getTransformers

        public ReportTransformer[] getTransformers()
        Returns:
        A pair of transformers, the first one for the original report, the second one for the added report. Or null if no good transformer can be found.
      • storeTranslations

        public static void storeTranslations​(int layer,
                                             CoordinateID bestTranslation,
                                             GameData globalData,
                                             GameData addedData)
        Stores the translation between the owner faction of global data and added data implied by the given translation.
      • getTransformBox

        public static boolean getTransformBox​(GameData globalData,
                                              GameData addedData,
                                              CoordinateID bestTranslation,
                                              CoordinateID bestAstralTranslation,
                                              BoxTransformer.BBoxes boxes)
        Compare coordinates of translated regions from new report to regions from global data and deduce boxes from the difference.
        Parameters:
        boxes - The result boxes are stored in this parameter.
        Returns:
        false if ambiguous boxes where found
      • getBoundingBox

        public static boolean getBoundingBox​(GameData data,
                                             BoxTransformer.BBoxes boxes)
        Try to find a translation based on region ids. Compares positions of wrappers in data with their original region and deduces box diameter from their difference.
        Parameters:
        boxes - The result boxes are stored in this parameter.
        Returns:
        false if ambiguous boxes where found