コード例 #1
0
ファイル: EventCard.java プロジェクト: ShaeBrown/Monopoly
  /*What effect does a GOBACK card have on a player?*/
  private void goback_effect(AbstractPlayer player) {
    int location = player.getLocation();

    if (location >= 0) location -= 3;
    else location = (Game.BOARDSIZE - location);

    player.setLocation(location);
  }
コード例 #2
0
ファイル: EventCard.java プロジェクト: ShaeBrown/Monopoly
 // is this supposed to be relative or absolute??
 // the advance to GO card moves the player 0 spaces.
 private void moveto_effect(AbstractPlayer player) {
   // Move player and if they pass go they collect $200
   int location = player.getLocation() + this.amount;
   if (location > (Game.BOARDSIZE - 1)) {
     location = location - (Game.BOARDSIZE - 1);
     player.addMoney(200);
   }
   player.setLocation(location);
 }
コード例 #3
0
ファイル: EventCard.java プロジェクト: ShaeBrown/Monopoly
 /*What effect does a GOTOJAIL card have on a player?*/
 private void gotojail_effect(AbstractPlayer player) {
   // TODO: Add jail effect
   player.setLocation(GRIDNUM.Jail.getNum());
 }