/// <summary> /// Load all the current blocks in the Block Chain. /// </summary> public static void LoadAllBlocks() { API.shared.consoleOutput($"{Main.Domino} Loading all blocks..."); string[] lines = File.ReadAllLines(Main.filePath); Block[] blocks = new Block[lines.Length]; for (int i = 0; i < lines.Length; i++) { blocks[i] = DeserializeBlock.FromJson(lines[i]); } Blocks = blocks; FileDoneWriting = true; API.shared.consoleOutput($"{Main.Domino} Blocks done loading."); Verification.VerifyAllPreviousBlocks(); }
public static string ToJson(this DeserializeBlock self) => JsonConvert.SerializeObject(self, BlockConverter.Settings);