private void FindWorkingSpace(ref List <List <IntPoint> > spaceSoFar)
        {
            ropesEntityList   = _entityBuilder.GetRopesEntities();
            rocketsEntityList = _entityBuilder.GetRocketsEntities();
            blowersEntityList = _entityBuilder.GetBlowersEntities();
            bubblesEntityList = _entityBuilder.GetBubblesEntities();
            bumpersEntityList = _entityBuilder.GetBumpersEntities();

            List <CompEntityPoly> allEntitiesList = new List <CompEntityPoly>();

            allEntitiesList.AddRange(rocketsEntityList);
            allEntitiesList.AddRange(blowersEntityList);
            allEntitiesList.AddRange(bubblesEntityList);
            allEntitiesList.AddRange(bumpersEntityList);

            spaceSoFar = GetRopesAreaPolys(ropesEntityList.Cast <RopeEntityPoly>().ToList());
            spaceSoFar = BumpersHandler.SetProperBumpersEffect(spaceSoFar, ropesEntityList, allEntitiesList, false);



            ExploreSearchSpace(ref spaceSoFar, allEntitiesList, ropesEntityList[0], true, 0);

            List <List <IntPoint> > result = new List <List <IntPoint> >();

            foreach (PolyLog polyLog in this.PolysLogger.Logs)
            {
                result = EntraSolver.GetPolySolution(result, polyLog.PolysUnion, ClipType.ctUnion);
            }
            spaceSoFar = result;
        }
        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));
        }