public void SetSelectionTarget(ShipSelection selection, bool teleport = false) { if (selection.Count <= 0) { throw new ArgumentException("Cannot set an empty selection as target", nameof(selection)); } var target = new SelectionTarget(selection, defaultSettings); SetTarget(target, teleport); }
public IEnumerable <Vector2> GetGlobalLayout(ShipSelection ships, Vector2 point) { if (!ships.Any()) { throw new ArgumentException("Cannot layout an empty collection", nameof(ships)); } // Direction is right aligned, so we subtract 90 degrees to correct var direction = point - ships.AveragePosition; var angle = direction.GetAngle(); foreach (var localShipPos in GetLocalLayout(ships)) { yield return(localShipPos.Rotate(angle) + point); } }
public SelectionTarget(ShipSelection selection, CameraTargetSettings settings) : base(settings) { this.selection = selection; SetZoomFromOrtho(selection.Max(ship => ship.BlockGrid.MaxSize) * 0.75f); }