/// <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(); }
/// <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(); } }
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()); }
/// <summary> /// Ejecuta un movimiento /// </summary> private void ExecuteMovement() { Selected = true; PgnGameViewModel.MoveTo(this); }
public MovementListViewModel(PgnGameViewModel pgnGameViewModel) { PgnGameViewModel = pgnGameViewModel; }