/// <summary>
 ///		Inicializa el tablero
 /// </summary>
 public void Init(PgnGameViewModel chessGameViewModel)
 {
     ViewModel = chessGameViewModel;
     ViewModel.ComboPathBoard.PropertyChanged  += ComboPathImages_PropertyChanged;
     ViewModel.ComboPathPieces.PropertyChanged += ComboPathImages_PropertyChanged;
     ViewModel.ResetGame += (sender, eventArgs) => Reset();
 }
Ejemplo n.º 2
0
 /// <summary>
 ///		Coloca la partida en un movimiento
 /// </summary>
 private void GoToMovement(MovementFigureViewModel movement)
 {
     // Inicializa el índice de movimientos
     _actualMovementIndex = 0;
     // Limpia el tablero
     GameBoard.Reset();
     PgnGameViewModel.RaiseEventReset();
     // Busca el movimiento
     while (_actualMovementIndex >= 0 && _actualMovementIndex < FigureMovements.Count &&
            _actualMovementIndex < movement.MovementIndex)
     {
         PgnGameViewModel.RaiseEventNextMovement();
     }
 }
Ejemplo n.º 3
0
 public MovementFigureViewModel(PgnGameViewModel pgnGameViewModel, MovementFigureModel movement, int movementIndex, int variationIndex)
 {
     // Inicializa las propiedades
     PgnGameViewModel = pgnGameViewModel;
     VariationIndex   = variationIndex;
     Selected         = false;
     Piece            = movement.OriginPiece;
     Color            = movement.Color;
     MovementIndex    = movementIndex;
     Movement         = movement;
     Text             = movement.Text;
     HasVariation     = movement.Variation != null;
     Time             = "01:07";
     // Inicializa la forma en que se debe ver el movimiento en la lista (tamaños de fuente, tamaños de imagen...)
     AssignViewSizes(variationIndex, Selected);
     // Inicializa los comandos
     SelectMovementCommand = new BaseCommand(parameter => ExecuteMovement(), parameter => CanExecuteMovement());
 }
Ejemplo n.º 4
0
 /// <summary>
 ///		Ejecuta un movimiento
 /// </summary>
 private void ExecuteMovement()
 {
     Selected = true;
     PgnGameViewModel.MoveTo(this);
 }
Ejemplo n.º 5
0
 public MovementListViewModel(PgnGameViewModel pgnGameViewModel)
 {
     PgnGameViewModel = pgnGameViewModel;
 }