Exemplo n.º 1
0
        /*
         * private void OnOrbitCommand()
         * {
         *  OrbitBodyCommand newmove = new OrbitBodyCommand()
         *  {
         *      RequestingFactionGuid = _cmdRef.FactionGuid,
         *      EntityCommandingGuid = _cmdRef.EntityGuid,
         *      CreatedDate = _cmdRef.GetSystemDatetime,
         *      TargetEntityGuid = TargetList.SelectedKey,
         *      ApoapsisInKM = this.Range,
         *      PeriapsisInKM = this.Perihelion,
         *  };
         *  _cmdRef.Handler.HandleOrder(newmove);
         * }*/

        private void OnMoveCommand()
        {
            WarpMoveCommand newmove = new WarpMoveCommand()
            {
                RequestingFactionGuid = _cmdRef.FactionGuid,
                EntityCommandingGuid  = _cmdRef.EntityGuid,
                CreatedDate           = _cmdRef.GetSystemDatetime,
                TargetEntityGuid      = TargetList.SelectedKey,
            };

            _cmdRef.Handler.HandleOrder(newmove);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the transit cmd.
        /// </summary>
        /// <param name="game">Game.</param>
        /// <param name="faction">Faction.</param>
        /// <param name="orderEntity">Order entity.</param>
        /// <param name="targetEntity">Target entity.</param>
        /// <param name="targetOffsetPos_m">Target offset position in au.</param>
        /// <param name="transitStartDatetime">Transit start datetime.</param>
        /// <param name="expendDeltaV_AU">Amount of DV to expend to change the orbit in AU/s</param>
        public static void CreateCommand(Game game, Entity faction, Entity orderEntity, Entity targetEntity, Vector3 targetOffsetPos_m, DateTime transitStartDatetime, Vector3 expendDeltaV)
        {
            var cmd = new WarpMoveCommand()
            {
                RequestingFactionGuid  = faction.Guid,
                EntityCommandingGuid   = orderEntity.Guid,
                CreatedDate            = orderEntity.Manager.ManagerSubpulses.StarSysDateTime,
                TargetEntityGuid       = targetEntity.Guid,
                TargetOffsetPosition_m = targetOffsetPos_m,
                TransitStartDateTime   = transitStartDatetime,
                ExpendDeltaV           = expendDeltaV,
            };

            game.OrderHandler.HandleOrder(cmd);
        }