예제 #1
0
        public EntraResult CheckPlayability(EngineManager engineState)
        {
            SetMembers(engineState);
            List <List <IntPoint> > reachableSpace = new List <List <IntPoint> >();

            FindWorkingSpace(ref reachableSpace);
            var frogEntity = new FrogEntityPoly(this, StaticData.EngineManager.FrogRB);
            List <List <IntPoint> > frogCompsInter = EntraSolver.GetPolySolution(reachableSpace, frogEntity.GetDefPoly(),
                                                                                 ClipType.ctIntersection);

            if (frogCompsInter.Count > 0)
            {
                //if (CanCookieFitInIntersection(StaticData.EngineManager.CookieRB, solution))
                //MessageBox.Show("The level is playable, recognized by Entra Agent.");
                return(new EntraResult(StaticData.EngineManager.FrogRB.PositionXNACenter2D,
                                       frogEntity.GetDefPoly(),
                                       frogCompsInter,
                                       reachableSpace,
                                       true));
            }
            return(new EntraResult(StaticData.EngineManager.FrogRB.PositionXNACenter2D,
                                   frogEntity.GetDefPoly(),
                                   frogCompsInter,
                                   reachableSpace,
                                   false));
        }
예제 #2
0
 public EntraPathAgent(EntraAgentSimple entra)
 {
     _entra   = entra;
     _log     = this._entra.PolysLogger.GetLog();
     AllPaths = new List <List <PolyLog> >();
     _frog    = new FrogEntityPoly(this._entra, this._entra.EngineState.FrogRB);
     InitializeFrogPoly();
     SetAllPaths();
 }
예제 #3
0
        public Bitmap GetPathBitmap(int indexPath, bool withInputImage)
        {
            FrogEntityPoly frog        = new FrogEntityPoly(this._entra, this._entra.EngineState.FrogRB);
            PolyLog        frogPolyLog = new PolyLog(frog, frog.GetDefPoly(), null);
            var            pathPoints  = BuildPath(frogPolyLog, AllPaths[indexPath]);
            var            form        = new PathForm(pathPoints, withInputImage);

            return(form.GetPathBitmap());
        }
예제 #4
0
        public void DrawShortestPath(int counter)
        {
            String         dirName     = "PolysTesting";
            FrogEntityPoly frog        = new FrogEntityPoly(this._entra, this._entra.EngineState.FrogRB);
            PolyLog        frogPolyLog = new PolyLog(frog, frog.GetDefPoly(), null);
            var            shortestP   = EntraPlusUsageManager.GetShortestPath(this.AllPaths)[0];

            var pathPoints = BuildPath(frogPolyLog, shortestP);
            var form       = new PathForm(pathPoints, true);

            form.DrawPathIntoOutput(dirName + @"\path " + counter + ".jpg");
        }
예제 #5
0
        public void DrawPaths()
        {
            String         dirName     = "PolysTesting";
            FrogEntityPoly frog        = new FrogEntityPoly(this._entra, this._entra.EngineState.FrogRB);
            PolyLog        frogPolyLog = new PolyLog(frog, frog.GetDefPoly(), null);

            for (int i = 0; i < AllPaths.Count; i++)
            {
                var pathPoints = BuildPath(frogPolyLog, AllPaths[i]);
                var form       = new PathForm(pathPoints, true);
                form.DrawPathIntoOutput(dirName + @"\path " + i + ".jpg");
            }
        }