// Dispose(bool disposing) executes in two distinct scenarios. // If disposing equals true, the method has been called directly // or indirectly by a user's code. Managed and unmanaged resources // can be disposed. // If disposing equals false, the method has been called by the // runtime from inside the finalizer and you should not reference // other objects. Only unmanaged resources can be disposed. protected void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!this.disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { foreach (var map in Maps) { map.Value.Dispose(); } if (CustomMaps != null) { foreach (var map in CustomMaps) { map.Value.Dispose(); } } } // Call the appropriate methods to clean up // unmanaged resources here. // If disposing is false, // only the following code is executed. Maps.Clear(); // Note disposing has been done. disposed = true; } }
public void Reset(bool exit = false) { if (null != c) { c.Destroy(); } c = null; if (null != s) { s.Destroy(); } if (exit) { return; } m_state = WorldState.CENTER; m_state_extra = WorldStateExtra.WORLDSTATE_1; TurnCamera(true); s = null; type = (GameMgrType)0; ObjectMgr.Instance.Clear(); player_pool.ClearAndRealloc(); bomb_pool.ClearAndRealloc(); pwr_up_pool.ClearAndRealloc(); if (maps != null) { maps.Clear(); } game_started = false; StopAllCoroutines(); Async.Instance.Restart(); }
public void Load(string filepath) { Maps.Clear(); using (FileStream inputStream = File.Open(filepath, FileMode.Open)) { var count = 0; using (var bR = new BinaryReader(inputStream)) { count = bR.ReadInt32(); CurrentMapIx = bR.ReadInt32(); MapBuilder.MapStream = inputStream; for (int i = 0; i < count; i++) { //ResetMapBuilder(); MapBuilder.MapCreationMode = MapBuilder.TableCreationMode.FromGameFile; var map = MapBuilder.Create(); Maps.AddOnce(map); } var listenerType = bR.ReadString(); atomListeners.Where(aL => aL.GetType().Name == listenerType) .ToList().ForEach(sal => ((ISaveableAtomListener)sal).LoadMessages(inputStream)); } } }
public void ClearMaps() { Maps.Clear(); MapBuilder.AddViewer(mapViewer); MapBuilder.AddSingleMessageListener(singleMsgListener); }
public SettingRepository Initialize() { Items.Clear(); Maps.Clear(); MapSymbols.Clear(); Strings.Clear(); Monster.Clear(); SkillBase.Clear(); EoBase.Clear(); Npc.Clear(); ModelAtr.Clear(); ModelCommon.Clear(); Load(Strings, "str_table.csv", new StrTableCsvReader()); Load(Items, "iteminfo.csv", new ItemInfoCsvReader()); Load(Monster, "monster.csv", new MonsterCsvReader()); Load(SkillBase, "skill_base.csv", new SkillBaseCsvReader()); //Load(CharacterAttack, "chara_attack.csv", new CharacterAttackCsvReader()); Load(EoBase, "eo_base.csv", new EoBaseCsvReader()); Load(Npc, "npc.csv", new NpcCsvReader()); Load(ModelAtr, "model_atr.csv", new ModelAtrCsvReader()); Load(Maps, "map.csv", new MapCsvReader(Strings)); //Load(MapSymbols, "map_symbol.csv", new MapSymbolCsvReader()); Load(ModelCommon, "model_common.csv", new ModelCommonCsvReader(Monster, ModelAtr)); return(this); }
public void Load(string file) { Maps.Clear(); _load(new ByteReader(File.ReadAllBytes(file))); LoadedPath = file; Commands.ClearCommands(); }
public static void LoadMapDetails(IEnumerable <RdlTag> mapTags) { Maps.Clear(); foreach (var detail in mapTags) { Maps.Add(new MapDetail(detail)); } }
/// <summary> /// Clear out the configuration /// </summary> /// <param name="args"></param> private void OnProjectOpened(ProjectEventArgs args) { Maps.Clear(); FeatureLayers.Clear(); Fields.Clear(); Prefix = string.Empty; Suffix = string.Empty; FileExtension = string.Empty; FileWorkspace = string.Empty; }
/// <summary> /// Clear out the configuration /// </summary> /// <param name="args"></param> private void OnProjectOpened(ProjectEventArgs args) { Maps.Clear(); FeatureLayers.Clear(); Fields.Clear(); _fileList.Clear(); Prefix = string.Empty; Suffix = string.Empty; FileWorkspace = string.Empty; DestinationWorkspace = string.Empty; FileCloningMethod = EnumFileCloningMethod.None; }
public async Task LoadAllAsync() { List <UserMap> maps = await App.UnitOfWork .UserMapRepository .FindAllJoinedMapsAsync(App.UserViewModel.LoggedUser.Id); Maps.Clear(); foreach (UserMap m in maps) { Maps.Add(m); } }
/// <summary> /// Clear out the configuration /// </summary> /// <param name="args"></param> private void OnProjectOpened(ProjectEventArgs args) { Maps.Clear(); FeatureLayers.Clear(); Fields.Clear(); _FileList.Clear(); Prefix = string.Empty; Suffix = string.Empty; FileExtension = string.Empty; FileWorkspace = string.Empty; FileLoadingMethod = EnumFileLoadingMethod.None; }
public void ClearTopoTable() { Log.InfoStart("ClearTopoTable"); Archors.Clear(); DevInfos.Clear(); Maps.Clear(); PhysicalTopologys.Clear(); TransformMs.Clear(); NodeKKSs.Clear(); Points.Clear(); Bounds.Clear(); Log.InfoEnd("ClearTopoTable"); }
public async void ReloadMaps() { var rconmaps = await GetMapsFromRcon(); var maps = Mh.PopulateMaps(rconmaps); Maps.Clear(); foreach (var map in maps) { Maps.Add(map); } }
public void Dispose() { Log?.Clear(); Entities?.Clear(); Actions?.Clear(); CalculatedFields?.Clear(); Connections?.Clear(); Environments?.Clear(); Maps?.Clear(); Relationships?.Clear(); Scripts?.Clear(); SearchTypes?.Clear(); Templates?.Clear(); }
void OnGUI() { wantsMouseMove = true; m_material = (Material)EditorGUILayout.ObjectField("1", m_material, typeof(Material)); m_grid_shader = (Material)EditorGUILayout.ObjectField("2", m_grid_shader, typeof(Material)); t = (Transform)EditorGUILayout.ObjectField("Stone template", t, typeof(Transform)); b = (Transform)EditorGUILayout.ObjectField("Breakable template", b, typeof(Transform)); size = EditorGUILayout.Vector2Field("Grid Size", size); if (GUILayout.Button("generate maps")) { Maps.s_material = m_material; Maps.s_grid = m_grid_shader; Maps.s_stone = t; Maps.s_breakable = b; if (maps != null) { maps.Clear(); } maps = new Maps(new IntVector2((int)size.x, (int)size.y)); maps.Generate(); } pos = (Vector2)EditorGUILayout.Vector2Field("position : ", pos); type = (MapsTiles)EditorGUILayout.EnumPopup("type : ", type); //Debug.Log("try to add a block"); if (GUILayout.Button("add block to maps")) { Debug.Log("try to add a block"); if (maps != null) { Debug.Log("add " + type + " block to maps"); maps.AddBlock(type, new IntVector2((int)pos.x, (int)pos.y)); } } path = EditorGUILayout.TextField("Path :", path); if (GUILayout.Button("Save to")) { maps.SaveToFile(path); } if (GUILayout.Button("load to")) { maps = Maps.LoadMapsFromFile(path); } }
public void BindServerObject(ServerModel server) { Server = server; MapManager = new MapManager(Server); MapManager.MapsDirectory = server.GetMapsDirectory(); var listMaps = Server.GetMapsToDownload() .Select(x => new MapModel(x, Server)) .ToList(); Maps.Clear(); foreach (var map in listMaps) { Maps.Add(map); } MapsSelectionStatus = $"{Maps.Count(x => !x.SkipOnDownload)} / {Maps.Count()} maps"; }
public void Reset() { Maps.Clear(); LoadedPath = null; Commands.ClearCommands(); }
void OnGUI() { GUI.Box(GuiUtils.ResizeGUI(new Rect(10, 50, 150, 500), true), ""); GUI.Label(GuiUtils.ResizeGUI(new Rect(15, 60, 80, 30), true), "Grid size :"); Debug.Log(GUI.GetNameOfFocusedControl()); GUI.SetNextControlName("x"); if (GUI.GetNameOfFocusedControl() == "x") { grid_x = GUI.TextField(GuiUtils.ResizeGUI(new Rect(15, 85, 45, 25), true), grid_x); } else { grid_x = (x = parseInt(GUI.TextField(GuiUtils.ResizeGUI(new Rect(15, 85, 45, 25), true), grid_x))).ToString(); } GUI.SetNextControlName("y"); if (GUI.GetNameOfFocusedControl() == "y") { grid_y = GUI.TextField(GuiUtils.ResizeGUI(new Rect(62, 85, 45, 25), true), grid_y); } else { grid_y = (y = parseInt(GUI.TextField(GuiUtils.ResizeGUI(new Rect(62, 85, 45, 25), true), grid_y))).ToString(); } //grid_y = (y = parseInt(GUI.TextField(GuiUtils.ResizeGUI(new Rect(62, 85, 45, 25), true), grid_y))).ToString(); selGridInt = GUI.SelectionGrid(GuiUtils.ResizeGUI(new Rect(30, 150, 100, 100), true), selGridInt, new string[] { "Empty tiles", "Solid block", "Breakable block" }, 1); if (GUI.Button(GuiUtils.ResizeGUI(new Rect(15, 120, 140, 25), true), "Generate maps")) { if (maps == null) { maps = new Maps(new IntVector2(x, y)); } else { maps.Clear(); maps.Size = new IntVector2(x, y); } maps.Generate(); } if (GUI.Button(GuiUtils.ResizeGUI(new Rect(15, 260, 140, 25), true), "Fill")) { maps.Fill((MapsTiles)selGridInt); } if (GUI.Button(GuiUtils.ResizeGUI(new Rect(15, 290, 140, 25), true), "Save to")) { if (maps != null) { maps.SaveToFile(filename + ".map"); } } if (GUI.Button(GuiUtils.ResizeGUI(new Rect(15, 320, 140, 25), true), "Load from")) { maps = Maps.LoadMapsFromFile(filename + ".map"); //maps.Clear(); //maps.Generate(); } filename = GUI.TextField(GuiUtils.ResizeGUI(new Rect(15, 350, 140, 25), true), filename); if (GUI.Button(GuiUtils.ResizeGUI(new Rect(15, 380, 140, 25), true), "Quit")) { Application.Quit(); } }
public void Resolve(HashSet <string> values) { var finalMaps = new List <string>(); var finalOpcodes = new List <string>(); var sorted = new List <KeyValuePair <LayerEnum, SettingsValues> >(_layers); sorted.Sort((left, right) => left.Key.CompareTo(right.Key)); foreach (var layer in sorted) { var json = JsonConvert.SerializeObject(layer.Value); JsonConvert.PopulateObject(json, this, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore } ); ApplyRules(values, finalMaps, finalOpcodes); if (layer.Value.Maps != null) { finalMaps.AddRange(layer.Value.Maps); } if (layer.Value.Opcodes != null) { finalOpcodes.AddRange(layer.Value.Opcodes); } } // todo: remove duplicates Maps = Maps ?? new List <string>(); Maps.Clear(); Maps.AddRange(finalMaps); Opcodes = Opcodes ?? new List <string>(); Opcodes.Clear(); Opcodes.AddRange(finalOpcodes); Rules = null; // validate some settings if (string.IsNullOrWhiteSpace(ProjectFolder)) { throw new Exception("Property 'projectFolder' is missing or empty."); } if (!Directory.Exists(ProjectFolder)) { throw new Exception("Property 'projectFolder' refers to a folder that could not be found."); } // get temp folder TempFolder = Path.Combine(ProjectFolder, ".zxdbg"); Directory.CreateDirectory(TempFolder); var logjson = JsonConvert.SerializeObject(this, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore } ); Logging.Write(Logging.Severity.Debug, "Resolved settings: " + logjson); Deserialized(); }
/// <summary> /// Unregisters all class maps. /// </summary> public virtual void UnregisterClassMap() { Maps.Clear(); }
/// <summary> /// Clear out the configuration /// </summary> /// <param name="args"></param> private void OnProjectOpened(ProjectEventArgs args) { Maps.Clear(); Layers.Clear(); }