예제 #1
0
파일: Domino.cs 프로젝트: UShandruk/Pub
 //Конструктор
 public Domino(deShowPlate ShowPlate)
 {
     this.ShowPlate = ShowPlate;
     map = new Plate[maxPoints + 1, maxPoints + 1];
     for (int x = 0; x <= maxPoints; x++) //0      1      2      3
         for (int y = 0; y <= x; y++) //    0      01     012    0123
             map[x, y] = new Plate(x, y);
 }
예제 #2
0
파일: FormDomino.cs 프로젝트: UShandruk/Pub
 //делегат
 void ShowPlate(int x, int y, Plate plate)
 {
     graph.visible = false;
     graph.Draw(animates[x, y]);
     switch (plate.state)
     {
         case State.hide: animates[x, y] = new AnimateTurn(domino.map[x, y].a, domino.map[x, y].b, x, y);
                          animates[x, y].Hide();
                          break;
         case State.open: animates[x, y] = new AnimateTurn(domino.map[x, y].a, domino.map[x, y].b, x, y);
                          animates[x, y].Open();
                          break;
         case State.mark: animates[x, y] = new AnimateMark(domino.map[x, y].a, domino.map[x, y].b, x, y);
                          animates[x, y].Open();
                          break;
         case State.drop: animates[x, y] = new AnimateMove(domino.map[x, y].a, domino.map[x, y].b, x, y);
                          animates[x, y].Open();
                          if (domino.IsOpenTop(x,y))
                              animates[x, y].Move(0, 0, 0, -600);
                          else
                              animates[x, y].Move(0, 0, 0, 600);
                          break;
     }
 }