Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public SelectionTarget(ShipSelection selection, CameraTargetSettings settings)
     : base(settings)
 {
     this.selection = selection;
     SetZoomFromOrtho(selection.Max(ship => ship.BlockGrid.MaxSize) * 0.75f);
 }