com.eriksilkensen.sudoku
Class BoardInventoryHelper

java.lang.Object
  extended by com.eriksilkensen.sudoku.BoardInventoryHelper

public class BoardInventoryHelper
extends java.lang.Object

Helper class that should be used whenever information about the Inventory is needed.

Since:
1.0
Version:
03/08/07
Author:
Erik Silkensen

Constructor Summary
BoardInventoryHelper()
          Initializes the inventory by reading it in.
 
Method Summary
 Board getBoard(BoardDifficulties difficulty)
          Returns a Board at the specified difficulty level
 Board getBoard(int ID)
          Gets the Board with the specified ID number
 BoardInventory getBoardInventory()
          Returns the Inventory
 int getIndividualSize()
          Returns the individual size - or the size of each difficulty level - of the Inventory
 int getTotalSize()
          Returns the total size of the Inventory
 void supplyInventory(int numBoardsPerDifficulty)
          Supplies the Inventory with the specified number of Boards per difficulty level.
 void updateInventory()
          Updates the Inventory by writing it out to the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoardInventoryHelper

public BoardInventoryHelper()
Initializes the inventory by reading it in. If an exception is caught and the inventory file doesn't exist, an attempt is made to quickly initialize it with 1 Board per difficulty

Method Detail

getBoardInventory

public BoardInventory getBoardInventory()
Returns the Inventory


getBoard

public Board getBoard(BoardDifficulties difficulty)
Returns a Board at the specified difficulty level


getBoard

public Board getBoard(int ID)
Gets the Board with the specified ID number


supplyInventory

public void supplyInventory(int numBoardsPerDifficulty)
Supplies the Inventory with the specified number of Boards per difficulty level. This method should probably not be used during the playing of the actual game.


updateInventory

public void updateInventory()
Updates the Inventory by writing it out to the file


getTotalSize

public int getTotalSize()
Returns the total size of the Inventory


getIndividualSize

public int getIndividualSize()
Returns the individual size - or the size of each difficulty level - of the Inventory