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)); }
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(); }
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()); }
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"); }
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"); } }