first commit
This commit is contained in:
69
CS1322/p6/MyWay/CGrid.java
Normal file
69
CS1322/p6/MyWay/CGrid.java
Normal file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* <PRE>
|
||||
* CGrid.java
|
||||
*
|
||||
* Revisions: 1.0 Nov. 17, 2002
|
||||
* Created the CGrid class
|
||||
*
|
||||
* </PRE>
|
||||
*
|
||||
* @author <A HREF="mailto:gtg184g@mail.gatech.edu">Jose Manuel Caban</A>
|
||||
* @version Version 1.0, Nov. 17, 2002
|
||||
*/
|
||||
|
||||
import java.io.*;
|
||||
|
||||
public class CGrid {
|
||||
|
||||
/**
|
||||
*2D array to store the game data
|
||||
*/
|
||||
private CCoord[][] grid;
|
||||
|
||||
////////////////
|
||||
//Constructors//
|
||||
////////////////
|
||||
|
||||
public CGrid(){
|
||||
//create default size
|
||||
this(15,15);
|
||||
}
|
||||
|
||||
public CGrid(int iLength, int iHeight){
|
||||
grid = new CCord[iLength][iHeight];
|
||||
}
|
||||
|
||||
public CGrid(String inFile){
|
||||
this(15,15);
|
||||
this.scanMap();
|
||||
}
|
||||
|
||||
public CGrid(String inFile, boolean varGrid){
|
||||
if(varGrid){
|
||||
scanMap(inFile);
|
||||
}
|
||||
else{
|
||||
this(15,15);
|
||||
scanMap(inFile);
|
||||
}
|
||||
}
|
||||
|
||||
///////////
|
||||
//Methods//
|
||||
///////////
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Debugging main for class CGrid.
|
||||
* This method will rigorously test my code.
|
||||
*
|
||||
* <br><br>
|
||||
* @param args a String array of command line arguments.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
}// end of main(String[] args)
|
||||
|
||||
}// end of class CGrid
|
||||
Reference in New Issue
Block a user