public static void AddHollowBlockEntry(HollowBlockEntry entry) { Tuple <string, int> last = PlayerDatav2.hollowBlockTally.Keys.Last(); PlayerDatav2.hollowBlockTally.Add(last, entry); // Debug.Log (last); }
void RecordData() { foreach (HollowBlock block in hollowBlocks) { if (block.IsSolved()) { currentKey = new Tuple <string, int> ("Hollow Block", PlayerDatav2.hollowBlockIndex); DataManagerv2.CreateEmptyEntry(currentKey); HollowBlockEntry entry = new HollowBlockEntry(); entry.name = "Hollow Block " + PlayerDatav2.hollowBlockIndex; entry.topic = sceneTag.GetSceneTopic(); foreach (SkyFragmentPiece piece in block.GetSkyPieceContainer().GetSkyPieces()) { AttemptedAnswer attempt = new AttemptedAnswer(); attempt.SetNumerator(piece.GetNumerator()); attempt.SetDenominator(piece.GetDenominator()); entry.attemptedAnswers.Add(attempt); } DataManagerv2.UpdateHollowBlockEntry(DataManagerv2.GetHollowBlockLastKey(), entry); PlayerDatav2.IncrementHollowBlockIndex(); } // entry.correctAttempts = new List<int> (); } DataManagerv2.PrintHollowBlockDictionary(); }
public static void UpdateHollowBlockEntry(Tuple <string, int> key, HollowBlockEntry entry) { if (PlayerDatav2.hollowBlockTally.ContainsKey(key)) { PlayerDatav2.hollowBlockTally [key] = entry; } PrintHollowBlockDictionary(); }