import de.grogra.pf.io.PropertyFileReader;


/* #####################  PUBLIC VARIABLES AND CONSTANTS  ####################*/
// linux
//private final static String PATH = "/home/username/GroIMP/../";
//private final static String PATH = "/home/../..";
private final static String PATH = "/home/mhenke/Desktop/ToDo/PropertyFileDemo/";
// windows
//private final static String PATH = "c:\\...\\GroIMP\\..";

// select here the property / scenario you want to use
private final static String SCENARIO_FILE_NAME = "scenario.txt";



/*******************************************************************************
 * Variabel declaration
 *
 * loaded by initParameters()
 ******************************************************************************/

// test boolean
protected static boolean BOX;

// colour
protected static float[] RGB;

// name
protected static String NAME;

// object radius
protected static float RADIUS;

// and one integer
protected static int NUMBER;



/******************************************************************************
 * Help functions to load global parametes
 ******************************************************************************/
 
/*
 * main function to load all model parameter (variables and climate data)
 */
protected static boolean initParameters() {
	boolean error = false;
	error = error || loadPropertyFile();
//	error = error || loadClimateData();
	if (error) println("Error during reading of parameter file(s)!");
	return error;
}

private static boolean loadPropertyFile() {
	PropertyFileReader propertyFile = new PropertyFileReader(PATH + SCENARIO_FILE_NAME);

	//iff there was an error during reading the property file
	if(propertyFile.load()) return true;

	loadProperties(propertyFile);
	println("Parameter file successfully read. "+propertyFile.getNumberOfReadedPropertys()+" parameter read.");
	return false;
}

private static void loadProperties(PropertyFileReader propertyFile) {
	BOX = propertyFile.getBoolean("BOX");
	RGB = propertyFile.getFloatArray("RGB");
	NAME = propertyFile.getString("NAME");
	RADIUS = propertyFile.getDouble("RADIUS");
	NUMBER = propertyFile.getInteger("NUMBER");
}

// end property loader ********************************************************/

