Exemplo n.º 1
0
 private void btnLoadJson_Click(object sender, EventArgs e)
 {
     using (JsonViewForm view = new JsonViewForm())
     {
         view.ShowDialog(this);
         var level = view.Level;
         if (level != null)
         {
             LoadMap(level);
             RefreshView();
         }
     }
 }
Exemplo n.º 2
0
        private void btnViewJson_Click(object sender, EventArgs e)
        {
            var relief   = NormalizeRelief(_relief.Points);
            var dryMass  = Convert.ToDouble(nudDryMass.Value);
            var targetX  = Convert.ToDouble(nudTargetX.Value);
            var x        = Convert.ToDouble(nudStatusX.Value);
            var y        = Convert.ToDouble(nudStatusY.Value);
            var time     = Convert.ToDouble(nudStatusTime.Value);
            var hSpeed   = Convert.ToDouble(nudStatusHSpeed.Value);
            var vSpeed   = Convert.ToDouble(nudStatusVSpeed.Value);
            var fuelMass = Convert.ToDouble(nudStatusFuelMass.Value);
            var state    = Convert.ToInt32(nudStatusState.Value);
            var level    = Level.Create(relief, dryMass, targetX, x, y, time, hSpeed, vSpeed, fuelMass, state);

            using (JsonViewForm view = new JsonViewForm(level))
            {
                view.ShowDialog(this);
            }
        }