private void InitializeView() { foreach (IResource resource in _resources) { if (resource is Map) { OnMapsChanged?.Invoke(resource as Map); } } }
internal bool LoadMap(int id) { var map = GetResources <Map>().FirstOrDefault(m => m.ID == id); if (map != null) { OnMapsChanged?.Invoke(map); return(true); } return(false); }
internal void CreateMap(int id, string name, int width, int height) { var map = new Map() { ID = id, Name = name, Width = width, Height = height }; _resources.Add(map); _configs.Add(map, new MapConfig()); OnMapsChanged?.Invoke(_resources[_resources.Count - 1] as Map); }
internal bool LoadMap(string fileName) { if (File.Exists(fileName)) { var map = Map.ParseFile(fileName); if (!HasResource(map)) { _resources.Add(map); _configs.Add(map, new MapConfig()); OnMapsChanged?.Invoke(_resources[_resources.Count - 1] as Map); return(true); } } return(false); }