Beispiel #1
0
 /// <summary>
 /// Stop be queen
 /// </summary>
 public void UnBeQueen()
 {
     CheckerImpl = new SimpleChImpl(PlayerMoveDirection)
     {
         Cell = CheckerImpl.Cell
     };
     CheckerGraphicalImplementation.UnBeQueen();
 }
Beispiel #2
0
 /// <summary>
 /// Start be queen
 /// </summary>
 public void BeQueen()
 {
     CheckerImpl = new QueenChImpl(PlayerMoveDirection)
     {
         Cell = CheckerImpl.Cell
     };
     CheckerGraphicalImplementation?.BeQueen();
 }
Beispiel #3
0
 /// <summary>
 /// Make checker unselected
 /// </summary>
 public void Unselect()
 {
     CheckerGraphicalImplementation.ChancheBgColor(Color.Transparent);
     foreach (Move move in AllowedMoves)
     {
         move.ToCell.ChangeBgColor(Color.Gray);
         move.ToCell.Click -= move.Do;
         move.ToCell.Click -= move.AddSelfToGameMoveList;
     }
     GameDataHandler.Selected = null;
 }
Beispiel #4
0
 /// <summary>
 /// Make checker selected
 /// </summary>
 private void Select()
 {
     CheckerGraphicalImplementation.ChancheBgColor(Color.Khaki);
     foreach (Move move in AllowedMoves)
     {
         move.ToCell.ChangeBgColor(Color.BlueViolet);
         move.ToCell.Click += move.Do;
         move.ToCell.Click += move.AddSelfToGameMoveList;
     }
     GameDataHandler.Selected = this;
 }
Beispiel #5
0
 /// <summary>
 /// Constructor of checker
 /// </summary>
 /// <param name="cell">Cell, where the checker located</param>
 /// <param name="playerMoveDirection">Direction of moves</param>
 /// <param name="graphicalImplementation">Graphical implementation of checker</param>
 protected Checker(Cell cell, PlayerMoveDirection playerMoveDirection, CheckerGraphicalImplementation graphicalImplementation)
 {
     if (graphicalImplementation != null)
     {
         CheckerGraphicalImplementation              = graphicalImplementation;
         CheckerGraphicalImplementation.SpriteClick += CheckerClick;
         CheckerGraphicalImplementation.SpriteClick += () => Click?.Invoke();
     }
     CheckerImpl = new SimpleChImpl(playerMoveDirection);
     Cell        = cell;
     // cell.Checker = this;
 }
Beispiel #6
0
 private CheckerGraphicalImplementation[,,] GenerateArrayCheckerImplementations()
 {
     CheckerGraphicalImplementation[,,] windowsCheckerImplementations = new CheckerGraphicalImplementation[2, 3, 4];
     for (int k = 0; k < 2; k++)
     {
         for (int i = 0; i < 3; i++)
         {
             for (int j = 0; j < 4; j++)
             {
                 windowsCheckerImplementations[k, i, j] = new WhinowsCheckerImplementation();
             }
         }
     }
     return(windowsCheckerImplementations);
 }
Beispiel #7
0
 /// <summary>
 /// Draw checker on field
 /// </summary>
 /// <param name="color"></param>
 /// <param name="cell"></param>
 protected void Draw(Color color, Cell cell)
 {
     CheckerGraphicalImplementation?.Draw(color, cell);
 }
Beispiel #8
0
 /// <summary>
 /// Get checker image
 /// </summary>
 /// <returns></returns>
 public Object GetImage()
 {
     return(CheckerGraphicalImplementation.GetImage());
 }
Beispiel #9
0
 public BlackChecker(Cell cell, PlayerMoveDirection playerMoveDirection, CheckerGraphicalImplementation checkerGraphical) : base(cell, playerMoveDirection, checkerGraphical)
 {
     Draw(Color.Black, cell);
 }