Esempio n. 1
0
        private void addToList(MouseEventArgs e, wallType type)
        {
            int x, y;

            transCoor(out x, out y, e.X, e.Y);
            wallList[x + y * 26] = Factory.createWall(type, x, y);
        }
Esempio n. 2
0
 public void MouseMove(MouseEventArgs e, wallType type)
 {
     if (isMouseDown)
     {
         addToList(e, type);
     }
 }
Esempio n. 3
0
 public static Wall createWall(wallType type, int x, int y)
 {
     if (wallType.wall == type)
     {
         return(new Wall(x * 30, y * 30, 30, 30, false, 1, wallType.wall));
     }
     else if (wallType.steel == type)
     {
         return(new Wall(x * 30, y * 30, 30, 30, false, 3, wallType.steel));
     }
     else if (wallType.grass == type)
     {
         return(new Wall(x * 30, y * 30, 30, 30, true, 1, wallType.grass));
     }
     else if (wallType.water == type)
     {
         return(new Wall(x * 30, y * 30, 30, 30, true, 1, wallType.water));
     }
     else if (wallType.home == type)
     {
         return(new Wall(x * 30, y * 30, 60, 60, false, 1, wallType.home));
     }
     return(null);
 }
Esempio n. 4
0
 private void btnGrass_Click(object sender, EventArgs e)
 {
     isBtnClick = true;
     type       = wallType.grass;
 }
Esempio n. 5
0
 private void btnWater_Click(object sender, EventArgs e)
 {
     isBtnClick = true;
     type       = wallType.water;
 }
Esempio n. 6
0
 private void btnSteel_Click(object sender, EventArgs e)
 {
     isBtnClick = true;
     type       = wallType.steel;
 }
Esempio n. 7
0
 public Wall(int x, int y, int width, int height, bool canPass, int hardness, wallType type) : base(x, y, width, height, canPass)
 {
     this.hardness = hardness;
     this.type     = type;
 }
Esempio n. 8
0
 public void setWallType(wallType type)
 {
     this.type = type;
 }
Esempio n. 9
0
 public void MouseUp(MouseEventArgs e, wallType type)
 {
     isMouseDown = false;
     addToList(e, type);
 }
Esempio n. 10
0
 public void MouseDown(MouseEventArgs e, wallType type)
 {
     isMouseDown = true;
     addToList(e, type);
 }