Example #1
0
 public void Init(eBoard _userBoard1, eBoard _userBoard2)
 {
     userBoard1 = _userBoard1;
     userBoard2 = _userBoard2;
     user1.Init(userBoard1, userBoard2);
     user2.Init(userBoard2, userBoard1);
 }
Example #2
0
 public void Init(eBoard _myBoard, eBoard _hisBoard, TableLayoutPanel _myPanel, TableLayoutPanel _hisPanel)
 {
     myBoard  = _myBoard;
     hisBoard = _hisBoard;
     myBoard.Subscribe(this);
     myPanel  = _myPanel;
     hisPanel = _hisPanel;
 }
Example #3
0
 public void Init(eBoard _userBoard1,
                  eBoard _userBoard2,
                  TableLayoutPanel _userPanelOne,
                  TableLayoutPanel _userPanelTwo,
                  TableLayoutPanel _userPanelThree,
                  TableLayoutPanel _userPanelFour)
 {
     userBoard1 = _userBoard1;
     userBoard2 = _userBoard2;
     UITools.LoadPanel(_userPanelThree, CellClick);
     UITools.LoadPanel(_userPanelFour, CellClick);
     user1.Init(userBoard1, userBoard2, _userPanelOne, _userPanelThree);
     user2.Init(userBoard2, userBoard1, _userPanelTwo, _userPanelFour);
 }
Example #4
0
        static void Main(string[] args)
        {
            List <eCell> eCells1 = new List <eCell>();

            eCells1.Add(new eCell(3, 3));
            eCells1.Add(new eCell(3, 4));
            eCells1.Add(new eCell(3, 5));
            List <eCell> eCells2 = new List <eCell>();

            eCells2.Add(new eCell(4, 3));
            eCells2.Add(new eCell(4, 4));
            eCells2.Add(new eCell(4, 5));
            List <eCell> eCells3 = new List <eCell>();

            eCells3.Add(new eCell(5, 3));
            eCells3.Add(new eCell(5, 4));
            eCells3.Add(new eCell(5, 5));
            List <eCell> eCells4 = new List <eCell>();

            eCells4.Add(new eCell(7, 3));
            eCells4.Add(new eCell(7, 4));
            eCells4.Add(new eCell(7, 5));
            eShip  ship1  = new eShip(eCells1);
            eShip  ship2  = new eShip(eCells2);
            eShip  ship3  = new eShip(eCells3);
            eShip  ship4  = new eShip(eCells4);
            eBoard board1 = new eBoard();
            eBoard board2 = new eBoard();
            eUser  user1  = new eUser("Ivan");
            eUser  user2  = new eUser("Bohdan");

            board1.AddShip(ship1);
            board1.AddShip(ship3);
            board2.AddShip(ship2);
            board2.AddShip(ship4);
            Game game = new Game(user1, user2);

            game.Init(board1, board2);
            game.Start();
        }
Example #5
0
 public void Init(eBoard _myBoard, eBoard _hisBoard)
 {
     myBoard  = _myBoard;
     hisBoard = _hisBoard;
     myBoard.Subscribe(this);
 }