public LandClaimMapData( ILogicObject area, WorldMapController worldMapController, ClientWorldMapLandClaimsGroupVisualizer landClaimGroupVisualizer, bool isFounder) { this.area = area; this.worldMapController = worldMapController; this.landClaimGroupVisualizer = landClaimGroupVisualizer; // add land claim mark control to map this.markControl = new WorldMapMarkLandClaim() { IsFounder = isFounder, Area = area }; var canvasPosition = this.GetAreaCanvasPosition(); Canvas.SetLeft(this.markControl, canvasPosition.X); Canvas.SetTop(this.markControl, canvasPosition.Y); Panel.SetZIndex(this.markControl, 12); worldMapController.AddControl(this.markControl); this.landClaimGroupVisualizer.Register(this.area); ClientUpdateHelper.UpdateCallback += this.UpdateCallback; }
public void Dispose() { if (this.markControl is not null) { this.worldMapController.RemoveControl(this.markControl); this.markControl = null; } this.landClaimGroupVisualizer.Unregister(this.area); ClientUpdateHelper.UpdateCallback -= this.UpdateCallback; }