RealBoard.java :  » Game » sysboard » base » Java Open Source

Java Open Source » Game » sysboard 
sysboard » base » RealBoard.java
package base;

import java.util.ArrayList;
import java.awt.Dimension;

public class RealBoard extends Board {
  
  /**
   * Represent the number of rows and columns of the board.
   */
  private Dimension size;
  
  /**
   * The list of all the pieces in the game.
   */
  private ArrayList<Piece> pieces = new ArrayList<Piece>();

  private ArrayList<UpgradeZone> upgradeZones;
  
  @Override
  public ArrayList<Piece> getPieces() {
    return new ArrayList<Piece>(this.pieces);
  }
  
  @Override
  public Dimension getSize() {
    return new Dimension(this.size);
  }
  
  @Override
  public ArrayList<UpgradeZone> getUpgradeZones() {
    return new ArrayList<UpgradeZone>(this.upgradeZones);
  }
  
  @Override
  public State getCurrentState(Piece piece) {
    return piece.getInitialState();
  }
  
  public RealBoard(Dimension size, ArrayList<Piece> pieces, ArrayList<UpgradeZone> upgradeZones) {
    this.size = size;
    this.pieces = pieces;
    this.upgradeZones = upgradeZones;
  }
}
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.