Coinage

Load Block Data

Oct 7th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.38 KB | None | 0 0
  1. public Block[] AllBlocks;
  2.  
  3. public void LoadBlockData
  4. {
  5.     if (File.Exists("blocks.txt"))
  6.     {
  7.         string[] data = File.ReadAllLines();
  8.         AllBlocks = new Blocks[data.Length];
  9.         foreach (string block in data)
  10.         {
  11.             string[] b = block.Split(' ');
  12.             AllBlocks[uint.Parse(b[1])] = new Block { Layer = uint.Parse(b[0]), ID = uint.Parse(b[1]), ParamCount = uint.Parse(b[2]) };
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment