/* * Simple constructor. */ public MarineDAO(iFileLoader saveLoader, iFileLoader defaultLoader) { this.saveLoader = saveLoader; this.defaultLoader = defaultLoader; string toLoadJson = saveLoader.Read(); //.Read() will return ERROR if the file does not exist. If this is the case //then we will wait for saveContents to get set in the BuildFilePath() function which //is predictably called before any DAO's are used. In the other case we are using the //save files which DO exist and so saveContents will get set here. if (!toLoadJson.Equals("ERROR")) { saveContents = ((Dictionary <string, System.Object>)Json.Deserialize(toLoadJson)); } string toLoadDef = defaultLoader.ReadDefault(); if (!toLoadDef.Equals("ERROR")) { defaultContent = ((Dictionary <string, System.Object>)Json.Deserialize(toLoadDef)); } }
public WeatherDAO(iFileLoader saves) { this.saves = saves; }
public EnvironmentVariableDAO(iFileLoader saves, iFileLoader defaults) { this.saves = saves; this.defaults = defaults; }
public LogFileDAO(LogFileLoader logDirectory) { directory = logDirectory; }