/// <summary> /// コンストラクタ /// </summary> public MainWindow_ViewModel() { _boardModel = new Reversi.Engine.Board(); Board_ViewModel = new Board_ViewModel(_boardModel); undoCMD = new DelegateCommand(() => Undo()); passCMD = new DelegateCommand(() => Pass()); startCMD = new DelegateCommand(() => Start()); }
/// <summary> /// コンストラクタ /// </summary> public MainWindow_ViewModel() { _boardModel = new Reversi.Engine.Board(); Board_ViewModel = new Board_ViewModel(_boardModel); undoCMD = new DelegateCommand(() =>Undo()); passCMD = new DelegateCommand(() => Pass()); startCMD = new DelegateCommand(() => Start()); }
/// <summary> /// コンストラクタ /// </summary> public Board_ViewModel(Reversi.Engine.Board boardModel) { _boardModel = boardModel; SquareList = new ObservableCollection <Square_ViewModel>(); for (int x = 1; x <= Reversi.Engine.Reversi.BOARD_SIZE; x++) { for (int y = 1; y <= Reversi.Engine.Reversi.BOARD_SIZE; y++) { int color = _boardModel.getColor(x, y); var item = new Square_ViewModel(); item.x = x; item.y = y; SquareList.Add(item); } } Reflesh(); }
/// <summary> /// コンストラクタ /// </summary> public Board_ViewModel(Reversi.Engine.Board boardModel) { _boardModel = boardModel; SquareList = new ObservableCollection<Square_ViewModel>(); for (int x = 1; x <= Reversi.Engine.Reversi.BOARD_SIZE ; x++) { for (int y = 1; y <= Reversi.Engine.Reversi.BOARD_SIZE ; y++) { int color = _boardModel.getColor(x, y); var item = new Square_ViewModel(); item.x = x; item.y = y; SquareList.Add(item); } } Reflesh(); }