示例#1
0
 public CellVM(Cell c, GameBusinessLogic businessLogic)
 {
     cell = c;
     this.businessLogic = businessLogic;
     CellWidth          = 58.3333321f;
     CellHeight         = 50.8888f;
 }
示例#2
0
        public GameVM()
        {
            ObservableCollection <ObservableCollection <Cell> > board = Utilities.InitGameBoard();

            this.businessLogic = new GameBusinessLogic(ref board);
            this.GameBoard     = CellBoardToCellVMBoard(ref board);
            this.WindowHeight  = 700;
            this.WindowWidth   = 1200;
        }
示例#3
0
        public GameVM()
        {
            InitialGameStatus = new GameStatusVM(System.IO.Directory.GetParent(Environment.CurrentDirectory).Parent.Parent.FullName + "/Resources/SatrtGame.txt");

            Board = Helper.ConvertIntegerMatrixToSquareMatrix(InitialGameStatus.Status.GameBoard);

            bl = new GameBusinessLogic(Board);

            GameBusinessLogic.CurrentPlayer = (Type)InitialGameStatus.Status.CurrentPlayer;

            GameBusinessLogic.NumberOfRedPieces = InitialGameStatus.Status.NumberOfRedPieces;

            GameBusinessLogic.NumberOfBlackPieces = InitialGameStatus.Status.NumberOfBlackPieces;

            GameBoard = Helper.CellBoardToCellVMBoard(Board, bl);
        }
示例#4
0
        public static void ResetGame()
        {
            Board = Helper.ConvertIntegerMatrixToSquareMatrix(InitialGameStatus.Status.GameBoard);

            bl = new GameBusinessLogic(Board);

            for (int line = 0; line < BOARD_DIMMENSION; line++)
            {
                for (int column = 0; column < BOARD_DIMMENSION; column++)
                {
                    GameBoard[line][column].SimpleSquare.Type = Board[line][column].Type;
                }
            }
            GameBusinessLogic.CurrentPlayer = (Type)InitialGameStatus.Status.CurrentPlayer;

            GameBusinessLogic.NumberOfRedPieces = InitialGameStatus.Status.NumberOfRedPieces;

            GameBusinessLogic.NumberOfBlackPieces = InitialGameStatus.Status.NumberOfBlackPieces;
        }
示例#5
0
        public GameVM()
        {
            ObservableCollection <ObservableCollection <Cell> > board = Helper.InitBoard();

            bl        = new GameBusinessLogic(board);
            GameBoard = CellBoardToCellVMBoard(board);



            menuServices = new MenuServices();


            Player player = Helper.InitPlayer();

            CurrentPlayer = new PlayerVM(player);


            PlayerWhite = new PlayerVM(Helper.PlayerWhite);
            PlayerRed   = new PlayerVM(Helper.PlayerRed);



            Winner = new PlayerVM(Helper.Winner);
        }
示例#6
0
 public CellVM(int x, int y, string color, Piece piece, GameBusinessLogic bl)
 {
     SimpleCell = new Cell(x, y, color, piece);
     this.bl    = bl;
 }
示例#7
0
 public SquareVM(Square square, GameBusinessLogic bl)
 {
     SimpleSquare = square;
     this.bl = bl;
 }
示例#8
0
 public GameVM()
 {
     ObservableCollection<ObservableCollection<Cell>> board = Helper.InitGameBoard();
     bl = new GameBusinessLogic(board);
     GameBoard = CellBoardToCellVMBoard(board);
 }
示例#9
0
 public CellVM(int x, int y, string hidden, string displayed, GameBusinessLogic bl)
 {
     SimpleCell = bl.cells[x][y];
     this.bl    = bl;
 }
 private void UpdateBoard(object param)
 {
     GameBusinessLogic.UpdateGame(this);
 }