private void makeDecision() { if (updateCounter++ % 10 != 0) { return; } List <TCPCommand> playerCommands = SoldiersTCPProtocol.convertMsgToCommands(createAutoAttackMsg(lastInput)); PlayerCommands outMsg = new PlayerCommands(botColor, playerCommands); theClientController.onOutgoingLocalMsgObj(outMsg, (short)SoldiersProtocol.MsgType.playerCommands); }
//Since we assume that there is only one bot from the local player we override protected override void readTCPMsg(ReceivedLocalMessage msg) { if (isGameOver) { return; } List <TCPCommand> playerCommands = SoldiersTCPProtocol.convertMsgToCommands(msg.message); if (playerCommands.Count == 0) { RealtimeTCPController.requestBoard(convertColorToTeam(localPlayerColor), true); return; } PlayerCommands outMsg = new PlayerCommands(localPlayerColor, playerCommands); sendServerMsg(outMsg, (short)SoldiersProtocol.MsgType.playerCommands); RealtimeTCPController.requestBoard(0, true); }