Android Open Source - bluedroid-mp Turn Info






From Project

Back to project page bluedroid-mp.

License

The source code is released under:

Apache License

If you think the Android project bluedroid-mp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package uk.ac.gcu.bluedroid.game;
//from w  ww .jav  a2  s. co  m
import uk.ac.gcu.bluedroid.util.Position;
import android.content.Context;
public class TurnInfo {

  public final static int HAS_NOT_RECRUITED = 0;
  public final static int SOLDIER_RECRUITED = 1;
  public final static int ARCHER_RECRUITED = 2;
  public final static int PALADIN_RECRUITED = 3;

  private int recruitedUnit = 0;
  
  private Position endPos = null;   
  private Position startPos = null;  
  private Position targetPos = null;
  private Position recruitPos = null;
  private boolean hasAttacked = false;
  private boolean hasMoved = false;
  private boolean hasRecruited = false;
  
  public TurnInfo (Position endPos, Position startPos, Position targetPos){
    this.endPos = endPos;
    this.startPos = startPos;
    this.targetPos = targetPos;
  }

  public TurnInfo (){

  }

  public Position getUnitStartPos(){
    return startPos;
  }

  public Position getUnitEndPos(){
    return endPos;
  }

  public Position getUnitTargetPos(){
    return targetPos;
  }
  
  public Position getRecruitPos(){
    return recruitPos;
  }

  public boolean getHasAttacked(){
    return hasAttacked;
  }
  
  public boolean getHasMoved(){
    return hasMoved;
  }
  
  public boolean getHasRecruited(){
    return hasRecruited;
  }
  
  public int getRecruitedUnit(){
    return recruitedUnit;
  }
  
  public void setUnitStartPos(Position pos){
    this.startPos = pos;
  }

  public void setUnitEndPos(Position pos){
    this.endPos = pos;
  }

  public void setUnitTargetPos(Position pos){
    this.targetPos = pos;
  }
  
  public void setRecruitPos(Position pos){
    this.recruitPos = pos;
  }

  public void setHasAttacked (boolean hasAttacked){
    this.hasAttacked = hasAttacked;
  }
  
  public void setHasMoved (boolean hasMoved){
    this.hasMoved = hasMoved;
  }
  
  public void setHasRecruited (boolean hasRecruited){
    this.hasRecruited = hasRecruited;
  }
  
  public void setRecruitedUnit (int type){
    switch (type) {
    case HAS_NOT_RECRUITED:
      this.recruitedUnit = HAS_NOT_RECRUITED;
      break;
    case SOLDIER_RECRUITED:
      this.recruitedUnit = SOLDIER_RECRUITED;
      break;
    case ARCHER_RECRUITED:
      this.recruitedUnit = ARCHER_RECRUITED;
      break;
    case PALADIN_RECRUITED:
      this.recruitedUnit = PALADIN_RECRUITED;
      break;
    }
  }
}




Java Source Code List

uk.ac.gcu.bluedroid.BluetoothChatService.java
uk.ac.gcu.bluedroid.DeviceListActivity.java
uk.ac.gcu.bluedroid.MainActivity.java
uk.ac.gcu.bluedroid.Wrapper.java
uk.ac.gcu.bluedroid.game.GameState.java
uk.ac.gcu.bluedroid.game.Map.java
uk.ac.gcu.bluedroid.game.Maps.java
uk.ac.gcu.bluedroid.game.Player.java
uk.ac.gcu.bluedroid.game.TurnInfo.java
uk.ac.gcu.bluedroid.resources.Camp.java
uk.ac.gcu.bluedroid.resources.Crop.java
uk.ac.gcu.bluedroid.resources.Mine.java
uk.ac.gcu.bluedroid.resources.Resource.java
uk.ac.gcu.bluedroid.units.Archer.java
uk.ac.gcu.bluedroid.units.Paladin.java
uk.ac.gcu.bluedroid.units.Soldier.java
uk.ac.gcu.bluedroid.units.Unit.java
uk.ac.gcu.bluedroid.util.CustomImageVIew.java
uk.ac.gcu.bluedroid.util.MyTextView.java
uk.ac.gcu.bluedroid.util.Node.java
uk.ac.gcu.bluedroid.util.Pathfinder.java
uk.ac.gcu.bluedroid.util.Position.java
uk.ac.gcu.bluedroid.util.Util.java