static void fun_playerMoved(int playerId) { Point point = DllInterface.getLastShotPoint(); ShotResult result = DllInterface.getLastShotResult(); Console.WriteLine("Player " + playerId + " shooted field (" + point.x + ", " + point.y + ") with result: " + result + "."); printBoardImage(DllInterface.getBoardImage(DllInterface.getLastShotBoard())); //printShipList(DllInterface.getShipList(DllInterface.getLastShotBoard())); }
static void Main(string[] args) { DllInterface.setCall_msg(fun_msg); DllInterface.setCall_enterPlannerMode(fun_enterPlannerMode); DllInterface.setCall_getCoords(fun_getCoords); DllInterface.setEvent_boardCreated(fun_boardCreated); DllInterface.setEvent_playerMoved(fun_playerMoved); InitData initData = new InitData { player1type = PlayerType.HUMAN, player2type = PlayerType.AI }; DllInterface.runProgram(initData); }
static void fun_boardCreated(int boardId) { Console.WriteLine("Board {0} created", boardId); printBoardImage(DllInterface.getBoardImage(boardId)); }
static void fun_enterPlannerMode() { Console.WriteLine("Entered into Planner Mode"); DllInterface.fillRandom(); Console.WriteLine("Filled Randomly"); }