Esempio n. 1
0
        public GridController(PictureBox _bitmap, BuilderController _builder)
        {
            this.canvas = _bitmap;
            GridConfig.Init(ref this.config);
            CreateGridPoints();
            this.canvas.MouseClick += OnClick;
            this.firstClick         = true;

            this.builder = _builder;
        }
Esempio n. 2
0
        private static void ReadJson(ref GridConfig _temp)
        {
            try
            {
                string file = Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName + "\\GreenLight\\src\\Grid\\GridConfig.json";

                using (StreamReader sr = new StreamReader(file))
                {
                    string json = sr.ReadToEnd();
                    _temp = JsonConvert.DeserializeObject <GridConfig>(json);
                }
            }catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Esempio n. 3
0
 public static void Init(ref GridConfig _temp)
 {
     GridConfig.ReadJson(ref _temp);
 }