Esempio n. 1
0
        public void setItem(object sender, EventArgs e, int x, int y)
        {
            MapChangedEventArgs MapChange = new MapChangedEventArgs();

            MapChange.x       = x;
            MapChange.y       = y;
            MapChange.Part    = Part;
            MapChange.setting = false;
            OnMapChange(MapChange);
        }
Esempio n. 2
0
        public void setItem(object sender, EventArgs e, string name)
        {
            MapChangedEventArgs MapChange = new MapChangedEventArgs();
            Regex regex = new Regex("/");

            string[] location = regex.Split(name);
            MapChange.x       = Int32.Parse(location[0]);
            MapChange.y       = Int32.Parse(location[1]);
            MapChange.Part    = Part;
            MapChange.setting = false;
            OnMapChange(MapChange);
        }
Esempio n. 3
0
        private void btnCheck_Click(object sender, EventArgs e)
        {
            MapChangedEventArgs check = new MapChangedEventArgs();

            check.check   = true;
            check.setting = false;
            OnMapChange(check);
            if (this.Errors.Items.Count < 1)
            {
                this.BtnSave.Enabled = true;
            }
        }
Esempio n. 4
0
 private void setMap(object sender, MapChangedEventArgs e)
 {
     if (e.setting)
     {
         Model.setSize(e.x, e.y);
     }
     else if (e.check)
     {
         View.setErrors(Model.getErrors());
     }
     else
     {
         Model.setItem(e.Part);
         Model.placeItem(e.x, e.y);
     }
 }
Esempio n. 5
0
        private void sizeGenerate_Click(object sender, EventArgs e)
        {
            clear();
            this.Picture = Image.FromFile(Directory.GetCurrentDirectory().ToString() + "\\Assets\\empty.png");
            int y = (int)this.ySize.Value;
            int x = (int)this.xSize.Value;

            theWidth  = x;
            theHeight = y;
            MapChangedEventArgs MapChange = new MapChangedEventArgs();

            MapChange.x       = x;
            MapChange.y       = y;
            MapChange.Part    = Part;
            MapChange.setting = true;
            OnMapChange(MapChange);
            setCells(x, y);
            this.btnCheck.Enabled = true;
            this.BtnSave.Enabled  = false;
        }
Esempio n. 6
0
        private void sizeGenerate_Click(object sender, EventArgs e)
        {
            clear();
            this.Picture = Items['-'];
            int y = (int)this.ySize.Value;
            int x = (int)this.xSize.Value;

            theWidth  = x;
            theHeight = y;
            MapChangedEventArgs MapChange = new MapChangedEventArgs();

            MapChange.x       = x;
            MapChange.y       = y;
            MapChange.Part    = Part;
            MapChange.setting = true;
            OnMapChange(MapChange);
            setPanels(x, y);
            this.btnCheck.Enabled = true;
            this.BtnSave.Enabled  = false;
            this.btnTest.Enabled  = false;
        }
Esempio n. 7
0
 protected void OnMapChange(MapChangedEventArgs e)
 {
     MapChanged(this, e);
 }