rendered paste body public boolean GameTurn() {
try {
while (PlayerTable.CountNodes() != 0 && ComputerTable.CountNodes() != 0) {
PlayerTurn();
ComputerTurn();
System.out.println(ComputerTable.PrintTable(ComputerTable.ViewOpponentsTable()));
System.out.println(PlayerTable.PrintTable(PlayerTable.linkedTable));
//System.out.println(ComputerTable.PrintTable(ComputerTable.linkedTable));
}
if (PlayerTable.CountNodes() == 0) {
JOptionPane.showMessageDialog(null, "Warchief, we have lost our Navy");
}
else if (ComputerTable.CountNodes() == 0) {
JOptionPane.showMessageDialog(null, "Warchief, we have won the battle!");
}
return true;
}
catch (Exception e) {
return false;
}
}