// This updates the VisualSectors and VisualThings that have their Changed property set private void UpdateChangedObjects() { foreach (KeyValuePair <Sector, VisualSector> vs in allsectors) { if (vs.Value != null) { BaseVisualSector bvs = (BaseVisualSector)vs.Value; if (bvs.Changed) { bvs.Rebuild(); } } } foreach (KeyValuePair <Thing, VisualThing> vt in allthings) { if (vt.Value != null) { BaseVisualThing bvt = (BaseVisualThing)vt.Value; if (bvt.Changed) { bvt.Rebuild(); } } } }
//mxd. call this to update sector and things in it when Sector.Fields are changed override public void UpdateSectorData() { //update sector data SectorData data = GetSectorData(); data.UpdateForced(); //update sector Rebuild(); //update things in this sector foreach (Thing t in General.Map.Map.Things) { if (t.Sector == this.Sector) { if (mode.VisualThingExists(t)) { // Update thing BaseVisualThing vt = (BaseVisualThing)mode.GetVisualThing(t); vt.Rebuild(); } } } }