Advertisement
Guest User

Untitled

a guest
Oct 26th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. public void transfer(Player player)
  2. {
  3. int x;
  4. System.out.println("Select source/target territories for a transfer.");
  5. status();
  6. choice();
  7. Territory territoryOutput = territoryInput();
  8. do
  9. {
  10. x = 0;
  11. do
  12. {
  13. if ( territoryOutput.ownerCheck() == player || territoryOutput.ownerCheck() == null )
  14. {
  15. player.placeArmies(-1,territoryOutput);
  16. x++;
  17. }
  18. else
  19. {
  20. choice();
  21. territoryOutput = territoryInput();
  22. }
  23. }
  24. while (x != 1);
  25. choice();
  26. territoryOutput = territoryInput();
  27. do
  28. {
  29. if( territoryOutput.ownerCheck() == player || territoryOutput.ownerCheck() == null )
  30. {
  31. player.placeArmies(1,territoryOutput);
  32. x++;
  33. }
  34. else
  35. {
  36. choice();
  37. territoryOutput = territoryInput();
  38. }
  39. }
  40. while (x != 2);
  41. status();
  42. choice();
  43. territoryOutput = territoryInput();
  44. }
  45. while ( territoryOutput != null );
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement