public void DownloadMap() { System.Net.WebClient mapdownloader = new WebClient(); Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist"); RegionBlock TempRegionData; XmlDocument doc = new XmlDocument(); doc.Load(regionliststream); regionliststream.Close(); XmlNode rootnode = doc.FirstChild; if (rootnode.Name != "regions") { // TODO - ERROR! } for (int i = 0; i <= rootnode.ChildNodes.Count; i++) { if (rootnode.ChildNodes.Item(i).Name != "region") { // TODO - ERROR! } else { TempRegionData = new RegionBlock(); } } }
public void DrawGrid(RegionBlock[][] regions) { for (int x=0; x<=regions.GetUpperBound(0); x++) { for (int y=0; y<=regions.GetUpperBound(1); y++) { Gdk.Image themap = new Gdk.Image(Gdk.ImageType.Fastest,Gdk.Visual.System,256,256); this.drawingarea1.GdkWindow.DrawImage(new Gdk.GC(this.drawingarea1.GdkWindow),themap,0,0,x*256,y*256,256,256); } } }