コード例 #1
0
 private void XYEndTB_TextChanged(object sender, TextChangedEventArgs e)
 {
     SCM.TBTreating(XEndTB, XSizeTB);
     SCM.TBTreating(YEndTB, YSizeTB);
     if (XEndTB.Text != "" && YEndTB.Text != "")
     {
         game.End = new cell(SCM.X(XEndTB), SCM.Y(YEndTB));
     }
 }
コード例 #2
0
        //logic events begin
        private void Player1TB_TextChanged(object sender, TextChangedEventArgs e)
        {
            SCM.TBTreating(XPlayer1TB, game.MapSizeX);
            SCM.TBTreating(YPlayer1TB, game.MapSizeY);
            SCM.TBTreating(LifePlayer1TB, MaxPlayer1Life);

            if (XPlayer1TB.Text != "" && YPlayer1TB.Text != "" && LifePlayer1TB.Text != "")
            {
                game.InitPlayer1(SCM.X(XPlayer1TB), SCM.Y(YPlayer1TB), SCM.Int32(LifePlayer1TB));
            }
        }
コード例 #3
0
 private void MapTB_TextChanged(object sender, TextChangedEventArgs e)
 {
     SCM.TBTreating(XMapTB, XSizeTB);
     SCM.TBTreating(YMapTB, YSizeTB);
     if (XMapTB.Text != "" && YMapTB.Text != "")
     {
         CostMapTB.Text = game.GetMapCell(SCM.X(XMapTB), SCM.Y(YMapTB)).Price.ToString();
     }
     if (XMapTB.Text == "" && YMapTB.Text == "")
     {
         CostMapTB.Clear();
     }
 }
コード例 #4
0
        //logic events begin
        private void SizeTB_TextChanged(object sender, TextChangedEventArgs e)
        {
            SCM.TBTreating(XSizeTB, MaxX);
            SCM.TBTreating(YSizeTB, MaxY);

            if (XSizeTB.Text != "" && YSizeTB.Text != "")
            {
                game.InitGameMap(SCM.Int32(XSizeTB), SCM.Int32(YSizeTB));
                Paint();
                CostMapTB.Text = "1";
                YMapTB.Text    = "1";
                XMapTB.Text    = "1";
            }
        }
コード例 #5
0
 private void LifePlayer2TB_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (XPlayer2TB.Text != "" && YPlayer2TB.Text != "")
     {
         SCM.TBTreating(LifePlayer2TB, MaxPlayer2Life);
         if (LifePlayer2TB.Text != "")
         {
             game.InitPlayer2(Convert.ToInt32(Player2CurrentChipLB.SelectedValue), SCM.X(XPlayer2TB), SCM.Y(YPlayer2TB), SCM.Int32(LifePlayer2TB));
         }
     }
     else
     {
         LifePlayer2TB.Clear();
     }
 }
コード例 #6
0
 private void CostMapTB_TextChanged(object sender, TextChangedEventArgs e)
 {
     if (XMapTB.Text != "" && YMapTB.Text != "")
     {
         SCM.TBTreating(CostMapTB, MaxCost);
         if (CostMapTB.Text != "")
         {
             game.InitMapCell(SCM.X(XMapTB), SCM.Y(YMapTB), SCM.Int32(CostMapTB));
             graphicTBs[SCM.X(XMapTB), SCM.Y(YMapTB)].Text = CostMapTB.Text;
         }
     }
     else
     {
         CostMapTB.Clear();
     }
 }
コード例 #7
0
        }  //check

        private void XYPlayer2TB_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (Player2CurrentChipLB.SelectedValue == null)
            {
                XPlayer2TB.Clear();
                YPlayer2TB.Clear();
            }
            else
            {
                SCM.TBTreating(XPlayer2TB, game.MapSizeX);
                SCM.TBTreating(YPlayer2TB, game.MapSizeY);
            }
            if (XPlayer2TB.Text == "" || YPlayer2TB.Text == "")
            {
                LifePlayer2TB.Clear();
            }
        }
コード例 #8
0
        private void graphicTextBoxes_TextChanged(object sender, TextChangedEventArgs e)
        {
            TextBox currentTextBox = sender as TextBox;

            if (currentTextBox != null)
            {
                SCM.TBTreating(currentTextBox, MaxCost);
                if (currentTextBox.Text != "")
                {
                    string[] indexes = currentTextBox.Name.Split('_', 'a');
                    int      x       = Convert.ToInt32(indexes[1]);
                    int      y       = Convert.ToInt32(indexes[2]);
                    game.InitMapCell(x, y, SCM.Int32(currentTextBox));
                    if (XMapTB.Text == indexes[1] && YMapTB.Text == indexes[2])
                    {
                        CostMapTB.Text = game.GetMapCell(x, y).Price.ToString();
                    }
                }
            }
        }