public PieceView(int x, int y, PieceColor color, BoardView controller) { this.board = controller; X = x; Y = y; Color = color; }
public ControlView(BoardView board) { noteContainer = new UIView(); noteContainer.AddRedBorder(); Add(noteContainer); gotoStartButton = UIButton.FromType(UIButtonType.Custom); gotoStartButton.SetBackgroundImage(UIImage.FromFile("controls/start.png"), UIControlState.Normal); Add(gotoStartButton); prevButton = UIButton.FromType(UIButtonType.Custom); prevButton.SetBackgroundImage(UIImage.FromFile("controls/previous.png"), UIControlState.Normal); Add(prevButton); playButton = UIButton.FromType(UIButtonType.Custom); playButton.SetBackgroundImage(UIImage.FromFile("controls/play.png"), UIControlState.Normal); Add(playButton); nextButton = UIButton.FromType(UIButtonType.Custom); nextButton.SetBackgroundImage(UIImage.FromFile("controls/next.png"), UIControlState.Normal); Add(nextButton); gotoEndButton = UIButton.FromType(UIButtonType.Custom); gotoEndButton.SetBackgroundImage(UIImage.FromFile("controls/end.png"), UIControlState.Normal); Add(gotoEndButton); gotoStartButton.TouchUpInside += board.GoToStart; prevButton.TouchUpInside += board.PreviousMove; playButton.TouchUpInside += board.Play; nextButton.TouchUpInside += board.NextMove; gotoEndButton.TouchUpInside += board.GoToEnd; }
public override void ViewWillAppear(bool animated) { View.BackgroundColor = UIColor.White; var board = new BoardView(); Add(board); var control = new ControlView(board); Add(control); board.SetControl(control); View.ConstrainLayout(() => board.Frame.Width == BoardView.BoardWidth && board.Frame.Height == BoardView.BoardWidth && board.Frame.Left == View.Frame.Left + 26 && board.Frame.Top == View.Frame.Top + 26 && control.Frame.Right == View.Frame.Right - 26 && control.Frame.Height == board.Frame.Height && control.Frame.Left == board.Frame.Right + 26 && control.Frame.Top == board.Frame.Top ); }
public Queen(int x, int y, PieceColor color, BoardView board) : base(x, y, color, board) { }
public Knight(int x, int y, PieceColor color, BoardView board) : base(x, y, color, board) { }
public Bishop(int x, int y, PieceColor color, BoardView board) : base(x, y, color, board) { }
public Rook(int x, int y, PieceColor color, BoardView board) : base(x, y, color, board) { }