/// <summary> /// /// </summary> /// <param name="view"></param> /// <param name="loc"></param> /// <param name="ab"></param> public override void OnClick(MapViewWindow view, Location loc, Point ab) { if (IsPlacing) { if (!selectedType.CanBeBuilt(loc, height)) { MessageBox.Show("Can not build"); //! MessageBox.Show("設置できません"); } else { CompletionHandler handler = new CompletionHandler(selectedType, loc, height, true); new ConstructionSite(loc, new EventHandler(handler.handle), new Distance(selectedType.Size, height)); } } else { VarHeightBuilding building = VarHeightBuilding.get(loc); if (building != null) { building.remove(); } } }
/// <summary> LocationDisambiguator implementation </summary> public override bool IsSelectable(Location loc) { if (IsPlacing) { // structures can be placed only on the ground return(GroundDisambiguator.theInstance.IsSelectable(loc)); } else { return(VarHeightBuilding.get(loc) != null); } }