Example #1
0
        /// <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();
        }
Example #2
0
 public static string ToJson(this DeserializeBlock self) => JsonConvert.SerializeObject(self, BlockConverter.Settings);