thanhpd / soen6441

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

Loadgame can be triggered after Loadmap command #325

Closed thanhpd closed 10 months ago

thanhpd commented 10 months ago

We may consider only allowing the loadgame command in the Preload phase.

!!!   Hi Welcome to Risk Game   !!!

!!!  Enter mode   !!!

!!!  Enter tournament or singleplayer   !!!

Please enter a command:
singleplayer
Command entered is: singleplayer

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

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

Please enter a command:
next
Command entered is: next
Map is valid

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

Please enter a command:
gameplayer -add p1 -add p2
Command entered is: gameplayer -add p1 -add p2

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

Created Player: p1

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

Created Player: p2

Please enter a command:
loadgame default4
Command entered is: loadgame default4

You are in the ISSUEORDER PHASE. Commands available are: [savegame, showmap, commit, quit, airlift, blockade, deploy, advance, negotiate, bomb]
Game loaded successfully

Issuing orders for player player3 (Human):
You can issue orders for 0 armies
You don't have any cards.

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                                                                       |player3     |6       |

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

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

|country4       |4  |continent2     |5    |3-country3, 6-country6                                                                                   |player2     |8       |

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

|country6       |6  |continent3     |8    |3-country3, 4-country4, 5-country5                                                                       |player3     |0       |

Issuing orders for player player3 (Human):
You can issue orders for 0 armies
You don't have any cards.