private Dictionary <int, int> GetOriginalDepthCounter() { var returnDictionary = new Dictionary <int, int>(); int pIndexCounter = SubmittedPuzzleTileCount; var reverseSubmittedPuzzleTiles = SubmittedPuzzleTilesIndices.OrderByDescending(c => c).ToList(); var lastInserted = 4; foreach (var pIndex in reverseSubmittedPuzzleTiles) { var leftOver = 7 - pIndexCounter; //Ok, so this should probably be calculated soon. But i need more time. //Hold my beer! It's calculated! if (SubmittedPuzzleTileCount == pIndexCounter) { returnDictionary.Add(pIndexCounter, 1); } else { returnDictionary.Add(pIndexCounter, leftOver * lastInserted); } if (SubmittedPuzzleTileCount != pIndexCounter) { lastInserted = leftOver * lastInserted * 4; } pIndexCounter--; } return(returnDictionary.OrderBy(s => s.Key).ToDictionary(s => s.Key, s => s.Value)); }
private Dictionary <UsedTileDictionaryKey, int> GetDynamicCheckedTileDictionary() { var returnDictionary = new Dictionary <UsedTileDictionaryKey, int>(); int pIndexCounter = SubmittedPuzzleTileCount; var reverseSubmittedPuzzleTiles = SubmittedPuzzleTilesIndices.OrderByDescending(c => c).ToList(); var lastInserted = 4; foreach (var pIndex in reverseSubmittedPuzzleTiles) { var leftOver = 7 - pIndexCounter; foreach (var tile in TotalRotationTileList) { var tileKey = new UsedTileDictionaryKey(pIndex, tile.TileNumber, tile.Degrees); //Ok, so this should probably be calculated soon. But i need more time. //Hold my beer! It's calculated! if (SubmittedPuzzleTileCount == pIndexCounter) { returnDictionary.Add(tileKey, 1); continue; } returnDictionary.Add(tileKey, leftOver * lastInserted); } if (SubmittedPuzzleTileCount != pIndexCounter) { lastInserted = leftOver * lastInserted * 4; } pIndexCounter--; } return(returnDictionary.OrderBy(s => s.Key.PuzzleIndex).ToDictionary(s => s.Key, s => s.Value)); }