コード例 #1
0
        private void towerChange(Tower tower)
        {
            A1.Invoke((Action) delegate { A1.Visible = false; });
            A2.Invoke((Action) delegate { A2.Visible = false; });
            A3.Invoke((Action) delegate { A3.Visible = false; });
            A4.Invoke((Action) delegate { A4.Visible = false; });
            A5.Invoke((Action) delegate { A5.Visible = false; });
            A6.Invoke((Action) delegate { A6.Visible = false; });
            B1.Invoke((Action) delegate { B1.Visible = false; });
            B2.Invoke((Action) delegate { B2.Visible = false; });
            B3.Invoke((Action) delegate { B3.Visible = false; });
            B4.Invoke((Action) delegate { B4.Visible = false; });
            B5.Invoke((Action) delegate { B5.Visible = false; });
            B6.Invoke((Action) delegate { B6.Visible = false; });
            C1.Invoke((Action) delegate { C1.Visible = false; });
            C2.Invoke((Action) delegate { C2.Visible = false; });
            C3.Invoke((Action) delegate { C3.Visible = false; });
            C4.Invoke((Action) delegate { C4.Visible = false; });
            C5.Invoke((Action) delegate { C5.Visible = false; });
            C6.Invoke((Action) delegate { C6.Visible = false; });



            if (tower.A[0] != 0)
            {
                A1.Invoke((Action) delegate { A1.Text = (tower.A[0] + ""); });
                A1.Invoke((Action) delegate { A1.Visible = true; });
            }

            if (tower.A[1] != 0)
            {
                A2.Invoke((Action) delegate { A2.Text = (tower.A[1] + ""); });
                A2.Invoke((Action) delegate { A2.Visible = true; });
            }

            if (tower.A[2] != 0)
            {
                A3.Invoke((Action) delegate { A3.Text = (tower.A[2] + ""); });
                A3.Invoke((Action) delegate { A3.Visible = true; });
            }
            if (tower.A[3] != 0)
            {
                A4.Invoke((Action) delegate { A4.Text = (tower.A[3] + ""); });
                A4.Invoke((Action) delegate { A4.Visible = true; });
            }
            if (tower.A[4] != 0)
            {
                A5.Invoke((Action) delegate { A5.Text = (tower.A[4] + ""); });
                A5.Invoke((Action) delegate { A5.Visible = true; });
            }
            if (tower.A[5] != 0)
            {
                A6.Invoke((Action) delegate { A6.Text = (tower.A[5] + ""); });
                A6.Invoke((Action) delegate { A6.Visible = true; });
            }


            if (tower.B[0] != 0)
            {
                B1.Invoke((Action) delegate { B1.Text = (tower.B[0] + ""); });
                B1.Invoke((Action) delegate { B1.Visible = true; });
            }

            if (tower.B[1] != 0)
            {
                B2.Invoke((Action) delegate { B2.Text = (tower.B[1] + ""); });
                B2.Invoke((Action) delegate { B2.Visible = true; });
            }

            if (tower.B[2] != 0)
            {
                B3.Invoke((Action) delegate { B3.Text = (tower.B[2] + ""); });
                B3.Invoke((Action) delegate { B3.Visible = true; });
            }
            if (tower.B[3] != 0)
            {
                B4.Invoke((Action) delegate { B4.Text = (tower.B[3] + ""); });
                B4.Invoke((Action) delegate { B4.Visible = true; });
            }
            if (tower.B[4] != 0)
            {
                B5.Invoke((Action) delegate { B5.Text = (tower.B[4] + ""); });
                B5.Invoke((Action) delegate { B5.Visible = true; });
            }
            if (tower.B[5] != 0)
            {
                B6.Invoke((Action) delegate { B6.Text = (tower.B[5] + ""); });
                B6.Invoke((Action) delegate { B6.Visible = true; });
            }


            if (tower.C[0] != 0)
            {
                C1.Invoke((Action) delegate { C1.Text = (tower.C[0] + ""); });
                C1.Invoke((Action) delegate { C1.Visible = true; });
            }

            if (tower.C[1] != 0)
            {
                C2.Invoke((Action) delegate { C2.Text = (tower.C[1] + ""); });
                C2.Invoke((Action) delegate { C2.Visible = true; });
            }

            if (tower.C[2] != 0)
            {
                C3.Invoke((Action) delegate { C3.Text = (tower.C[2] + ""); });
                C3.Invoke((Action) delegate { C3.Visible = true; });
            }
            if (tower.C[3] != 0)
            {
                C4.Invoke((Action) delegate { C4.Text = (tower.C[3] + ""); });
                C4.Invoke((Action) delegate { C4.Visible = true; });
            }
            if (tower.C[4] != 0)
            {
                C5.Invoke((Action) delegate { C5.Text = (tower.C[4] + ""); });
                C5.Invoke((Action) delegate { C5.Visible = true; });
            }
            if (tower.C[5] != 0)
            {
                C6.Invoke((Action) delegate { C6.Text = (tower.C[5] + ""); });
                C6.Invoke((Action) delegate { C6.Visible = true; });
            }
        }