thanhpd / soen6441

Concordia University - SOEN 6441 - Advanced Programming Practices
MIT License
1 stars 1 forks source link

Should have message about attacking/advancing army #220

Closed thanhpd closed 11 months ago

thanhpd commented 11 months ago

We should print out the advance order in the execution phase to indicate the result.

!!!   Hi Welcome to Risk Game   !!!

You are in the PRELOAD PHASE. Commands avaliable are: [loadmap]
Please enter a command:
loadmap src/main/resources/maps/basic.map
Command entered is: loadmap src/main/resources/maps/basic.map
Loading Map: basic.map
Map is valid

You are in the POSTLOAD PHASE. Commands avaliable are: [next, editneighbor, editcountry, editcontinent, validatemap, editmap, showmap]

Please enter a command:
next
Command entered is: next

You are in the PLAYSETUP PHASE. Commands avaliable are: [showmap, gameplayer, assigncountries]

Please enter a command:
gameplayer -add player1 -add player2
Command entered is: gameplayer -add player1 -add player2

===========
Running the -add option with the parameters [player1].

Created Player: player1

===========
Running the -add option with the parameters [player2].

Created Player: player2

Please enter a command:
assigncountries
Command entered is: assigncountries
Assigning Countries...

You are in the REINFORCEMENT PHASE. Commands avaliable are: [none]
Reinforcements have been assigned to the players.

You are in the ISSUEORDER PHASE. Commands avaliable are: [advance, showmap, blockade, airlift, commit, bomb, deploy, negotiate]

Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
showmap
Command entered is: showmap
Displaying Map
Map is valid
+---------------+---+---------------+-----+---------------------------------------------------------------------------------------------------------+------------+--------+

| Country       |ID | Continent     |Bonus| Neighbor Countries                                                                                      |   Owner    | Armies |

+---------------+---+---------------+-----+---------------------------------------------------------------------------------------------------------+------------+--------+

|country1       |1  |continent1     |5    |2-country2, 3-country3, 5-country5                                                                       |player2     |0       |

|country2       |2  |continent1     |5    |1-country1, 3-country3                                                                                   |player1     |0       |

|country3       |3  |continent2     |5    |1-country1, 2-country2, 4-country4, 6-country6                                                           |player1     |0       |

|country4       |4  |continent2     |5    |3-country3, 6-country6                                                                                   |player1     |0       |

|country5       |5  |continent3     |8    |1-country1, 6-country6                                                                                   |player2     |0       |

|country6       |6  |continent3     |8    |4-country4, 5-country5                                                                                   |player2     |0       |

Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
deploy 2 6
Command entered is: deploy 2 6
This order is added to the list of orders successfully.

Issuing orders for player player2:
You can issue orders for 9 armies

Please enter a command:
deploy 5 9
Command entered is: deploy 5 9
This order is added to the list of orders successfully.

Issuing orders for player player1:
You can issue orders for 0 armies

Please enter a command:
commit
Command entered is: commit
All orders are committed successfully.

Issuing orders for player player2:
You can issue orders for 0 armies

Please enter a command:
commit
Command entered is: commit
All orders are committed successfully.

You are in the EXECUTEORDER PHASE. Commands avaliable are: [none]
Executing orders now...
Player player1 deployed 6 armies to country 2
Player player2 deployed 9 armies to country 5

You are in the REINFORCEMENT PHASE. Commands avaliable are: [none]
Reinforcements have been assigned to the players.

You are in the ISSUEORDER PHASE. Commands avaliable are: [advance, showmap, blockade, airlift, commit, bomb, deploy, negotiate]
Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
showmap 
Command entered is: showmap
Displaying Map
Map is valid
+---------------+---+---------------+-----+---------------------------------------------------------------------------------------------------------+------------+--------+

| Country       |ID | Continent     |Bonus| Neighbor Countries                                                                                      |   Owner    | Armies |

+---------------+---+---------------+-----+---------------------------------------------------------------------------------------------------------+------------+--------+

|country1       |1  |continent1     |5    |2-country2, 3-country3, 5-country5                                                                       |player2     |0       |

|country2       |2  |continent1     |5    |1-country1, 3-country3                                                                                   |player1     |6       |

|country3       |3  |continent2     |5    |1-country1, 2-country2, 4-country4, 6-country6                                                           |player1     |0       |

|country4       |4  |continent2     |5    |3-country3, 6-country6                                                                                   |player1     |0       |

|country5       |5  |continent3     |8    |1-country1, 6-country6                                                                                   |player2     |9       |

|country6       |6  |continent3     |8    |4-country4, 5-country5                                                                                   |player2     |0       |

Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
advance country2 country1 3
Command entered is: advance country2 country1 3
This order is added to the list of orders successfully.

Issuing orders for player player2:
You can issue orders for 9 armies

Please enter a command:
deploy 5 9
Command entered is: deploy 5 9
This order is added to the list of orders successfully.

Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
deploy 2 6
Command entered is: deploy 2 6
This order is added to the list of orders successfully.

You are in the EXECUTEORDER PHASE. Commands avaliable are: [none]
Executing orders now...
Player player1 deployed 6 armies to country 2
Player player2 deployed 9 armies to country 5

You are in the REINFORCEMENT PHASE. Commands avaliable are: [none]
Reinforcements have been assigned to the players.

You are in the ISSUEORDER PHASE. Commands avaliable are: [advance, showmap, blockade, airlift, commit, bomb, deploy, negotiate]
Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
showmap
Command entered is: showmap
Displaying Map
Map is valid
+---------------+---+---------------+-----+---------------------------------------------------------------------------------------------------------+------------+--------+

| Country       |ID | Continent     |Bonus| Neighbor Countries                                                                                      |   Owner    | Armies |

+---------------+---+---------------+-----+---------------------------------------------------------------------------------------------------------+------------+--------+

|country1       |1  |continent1     |5    |2-country2, 3-country3, 5-country5                                                                       |player1     |3       |

|country2       |2  |continent1     |5    |1-country1, 3-country3                                                                                   |player1     |9       |

|country3       |3  |continent2     |5    |1-country1, 2-country2, 4-country4, 6-country6                                                           |player1     |0       |

|country4       |4  |continent2     |5    |3-country3, 6-country6                                                                                   |player1     |0       |

|country5       |5  |continent3     |8    |1-country1, 6-country6                                                                                   |player2     |18      |

|country6       |6  |continent3     |8    |4-country4, 5-country5                                                                                   |player2     |0       |

Issuing orders for player player1:
You can issue orders for 6 armies

Please enter a command:
YajingLiu2357 commented 11 months ago

add some output messages in advance to tell the user whether this command is issued or executed successfully. If the order can not be executed, the reason should be shown.