public void BuildMap() { Map = DlmFile.ReadMap(); foreach (var dlmLayer in Map.Layers) { var layer = new ObjectsLayer(dlmLayer.LayerId); m_layers.Add(layer); var elements = new List <GfxElement>(); foreach (var cell in dlmLayer.Cells) { elements.AddRange(from element in cell.Elements.OfType <DlmGraphicalElement>() let graphicElement = WorldGFXManager.GetElement((int)element.ElementId) as NormalGraphicalElementData where graphicElement != null let gfx = WorldGFXManager.GetGfx(graphicElement.Gfx) where gfx != null select new GfxElement(element, graphicElement, gfx, layer)); } layer.IsVisible = true; layer.Elements.AddRange(elements); } m_layers.Add(new GridLayer() { IsVisible = true }); }
public IList <BrowsableGfx> FetchRange(int startIndex, int count) { var page = new List <BrowsableGfx>(); for (int i = 0; i < count && i + startIndex < m_elements.Length; i++) { var element = m_elements[i + startIndex]; page.Add(new BrowsableGfx(element.Gfx, WorldGFXManager.GetGfx(element.Gfx))); } return(page); }