private void pointsDistribution(int arrayLength) { TrailPlan.addPoint(new Point()); while (TrailPlan.getNumberOfPoints() < arrayLength) { Point tempPoint = new Point(); if ((!isContain(TrailPlan.getTrailPlan(), tempPoint)) && UnityEngine.Random.value <= 0.2) { TrailPlan.addPoint(tempPoint); } } }
// Use this for initialization public void Start() { endTurnListener(); tab.hiddenListener(); tab.trailsListeners(); tab.quitMenulListeners(); tab.addButtonsListeners(); pointsDistribution(_trailLength); if (BRUTE_FORCE_MODE) { bruteForce(); tab.showPlayerResult(); } bts = tab.startGame(TrailPlan.getTrailPlan()); if (BRUTE_FORCE_MODE) { bruteForceBestTrail = bruteForcePopulation.getFittest(); tab.showResultTrail(bruteForceBestTrail.getTrail(), true); } }