コード例 #1
0
        //by clicking on each tile take the number of row, column, and type of the tile
        // if it is a box. Then, keep related image in the currentTool
        private void Tile_Click(object sender, EventArgs e)
        {
            Grides mytile = sender as Grides;

            currentTile = mytile;
            currentRow  = currentTile.row;
            currentCol  = currentTile.column;
            currentType = tile[currentRow, currentCol].type;
            switch (currentType)
            {
            case 6:
                currentTool = Grides.ObstacleType.blueBox;
                break;

            case 7:
                currentTool = Grides.ObstacleType.redBox;
                break;

            case 8:
                currentTool = Grides.ObstacleType.greenBox;
                break;

            case 9:
                currentTool = Grides.ObstacleType.yellowBox;
                break;

            default:

                MessageBox.Show("You should select just a box");
                break;
            }
        }
コード例 #2
0
 private void buttonYellowBox_Click(object sender, EventArgs e)
 {
     currentTool = Grides.ObstacleType.yellowBox;
 }
コード例 #3
0
 private void buttonGreenBox_Click(object sender, EventArgs e)
 {
     currentTool = Grides.ObstacleType.greenBox;
 }
コード例 #4
0
 private void buttonRedDoor_Click(object sender, EventArgs e)
 {
     currentTool = Grides.ObstacleType.redDoor;
 }
コード例 #5
0
 private void buttonWall_Click(object sender, EventArgs e)
 {
     currentTool = Grides.ObstacleType.Wall;
 }
コード例 #6
0
 /// <summary>
 /// add the clicked image (from the images list) to the currentTool
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonNone_Click(object sender, EventArgs e)
 {
     currentTool = Grides.ObstacleType.None;
 }