protected void UpdateVisibility(tPlanetsGroup pg, tAstroMapType mt, tPlanetType pt) { GroupMapPlanetsVisibilityCollection gmpvc = GroupMapPlanetsVisibilityCollectionLst.Where(x => x.PlanetGroup == pg).First(); MapPlanetsVisibilityCollectionProcessor proc = new MapPlanetsVisibilityCollectionProcessor(); proc.Data = gmpvc.MapPlanetsVisibilityCollection; proc.ToggleValue(mt, pt); }
private void OnDoubleClickPanel(object sender, EventArgs e) { MouseEventArgs me = e as MouseEventArgs; int X = me.X; int Y = me.Y; int count = MapPlanetsVisibilityCollection[0].PlanetsVisibilityList.Count; if (Y <= (count + 1) * _painter._Height_Grid_Cell) { int planet = Y / _painter._Height_Grid_Cell - 1; int map = X / _painter._Width_Grid_Cell - 1; MapPlanetsVisibilityCollectionProcessor proc = new MapPlanetsVisibilityCollectionProcessor(false) { Data = MapPlanetsVisibilityCollection }; int iShift = GetShift(); proc.ToggleValue((tAstroMapType)map, (tPlanetType)(planet + iShift)); Refresh(); } }