Cell.java :  » Game » androidwars64 » com » androidwars » Android Open Source

Android Open Source » Game » androidwars64 
androidwars64 » com » androidwars » Cell.java
package com.androidwars;

public class Cell {
  private int x, y;
  private Unit containedUnit;
  
  public Cell(int x, int y){
    this.x = x;
    this.y = y;
  }
  
  public int getX(){
    return x;
  }
  
  public int getY(){
    return y;
  }
  
  public boolean isEmpty(){
    return(containedUnit == null);
  }
  
  public Unit getUnit(){
    return containedUnit;
  }
  
  public void flushUnit(){
    containedUnit = null;
  }
  
  public void setUnit(Unit unit){
    containedUnit = unit;
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.