private string SaveObsDataAs() { fileDialog.InitialDirectory = LoadDirectory; currentObserverData = Observer.GetObserverData(); Response response = fileDialog.SaveFile(currentObserverData, extension, name, saveDataFileName); switch (response.ValidData) { case true: saveDataFileName = response.DirectoryPath; return response.DirectoryPath; default: return ""; }; }
private string SaveObsData() { if (saveDataFileName == "") { saveDataFileName = SaveObsDataAs(); return saveDataFileName; } currentObserverData = Observer.GetObserverData(); Archive.SaveData(currentObserverData, saveDataFileName); return saveDataFileName; }
private void getGameObjects(ObserverData observerData) { ClearGameObjectListBox(); foreach (KeyValuePair<string, GameObject> obj in observerData.ObjectList) { Observer.ObserveGameObject(obj.Value); displayObjectList.Add(obj.Key, obj.Value); } fillGameObjectListBox(); }
private void loadObsToolStripMenuItem_Click(object sender, EventArgs e) { Response response = fileDialog.LoadFile<ObserverData>(extension, name); if (!response.ValidData) return; currentObserverData = (ObserverData)response.Data; LoadDirectory = response.DirectoryPath; getGameObjects(currentObserverData); }
public GameData(ObserverData observerData) { ObserverData = observerData; }