private void FindNeighboursForEachPattern(PatternDataResults patternFinderResult, Dictionary <int, PatternNeighbours> result) { for (int row = 0; row < patternFinderResult.GetGridLengthY(); row++) { for (int col = 0; col < patternFinderResult.GetGridLengthX(); col++) { PatternNeighbours neighbours = PatternFinder.CheckNeighboursInEachDirection(col, row, patternFinderResult); PatternFinder.AddNeighboursToDictionary(result, patternFinderResult.GetIndexAt(col, row), neighbours); } } }
private void CreatePatterns <T>(ValuesManager <T> valueManager, IFindNeighbourStrategy strategy, bool equalWeights) { var patternFinderResult = PatternFinder.GetPatternDataFromGrid(valueManager, _patternSize, equalWeights); //StringBuilder builder = null; //List<string> list = new List<string>(); //for (int row = 0; row < patternFinderResult.GetGridLengthY(); row++) //{ // builder = new StringBuilder(); // for (int col = 0; col < patternFinderResult.GetGridLengthX(); col++) // { // builder.Append(patternFinderResult.GetIndexAt(col,row) + " "); // } // list.Add(builder.ToString()); //} //list.Reverse(); //foreach (var item in list) //{ // Debug.Log(item); //} patternDataIndexDictionary = patternFinderResult.PatternIndexDictionary; GetPatternNeighbours(patternFinderResult, strategy); }
private void GetPatternNeighbours(PatternDataResults patternFinderResult, IFindNeighbourStrategy strategy) { patternPossibleNeighboursDictionary = PatternFinder.FindPossibleNeighboursForAllPatterns(strategy, patternFinderResult); }