Ejemplo n.º 1
0
        internal ThrusterInfo(ThrusterType type, int level)
        {
            this.Type  = type;
            this.Level = level;

            this.vars = new Var(AComponentType.LevelKey, level).Get;
        }
Ejemplo n.º 2
0
        public ThrusterToolItem(EditorOptions options, ThrusterType thrusterType)
            : base(options)
        {
            if (thrusterType == ThrusterType.Custom)
            {
                throw new ArgumentException("Can't pass custom into this overload");
            }

            this.ThrusterType = thrusterType;

            _subName = thrusterType.ToString().ToLower().Replace('_', ' ');
            _directions = null;

            this.TabName = PartToolItemBase.TAB_SHIPPART;

            _visual2D = PartToolItemBase.GetVisual2D(this.Name, this.Description, options, this);
        }
Ejemplo n.º 3
0
        public static Vector3D[] GetThrusterDirections(ThrusterType thrusterType)
        {
            Vector3D[] retVal = null;

            switch (thrusterType)
            {
                case ThrusterType.One:
                    #region OneWay

                    // Directions
                    retVal = new Vector3D[1];
                    retVal[0] = new Vector3D(0, 0, 1);		// the visual's bottle points down, but the thrust is up

                    #endregion
                    break;

                case ThrusterType.Two:
                    #region TwoWay

                    // Directions
                    retVal = new Vector3D[2];
                    retVal[0] = new Vector3D(0, 0, 1);
                    retVal[1] = new Vector3D(0, 0, -1);

                    #endregion
                    break;

                case ThrusterType.Two_One:
                    #region Two_One

                    // Directions
                    retVal = new Vector3D[3];
                    retVal[0] = new Vector3D(0, 0, 1);
                    retVal[1] = new Vector3D(0, 0, -1);
                    retVal[2] = new Vector3D(1, 0, 0);

                    #endregion
                    break;

                case ThrusterType.Two_Two:
                    #region Two_Two

                    // Directions
                    retVal = new Vector3D[4];
                    retVal[0] = new Vector3D(0, 0, 1);
                    retVal[1] = new Vector3D(0, 0, -1);
                    retVal[2] = new Vector3D(1, 0, 0);
                    retVal[3] = new Vector3D(-1, 0, 0);

                    #endregion
                    break;

                case ThrusterType.Two_Two_One:
                    #region Two_Two_One

                    // Directions
                    retVal = new Vector3D[5];
                    retVal[0] = new Vector3D(0, 0, 1);
                    retVal[1] = new Vector3D(0, 0, -1);
                    retVal[2] = new Vector3D(1, 0, 0);
                    retVal[3] = new Vector3D(-1, 0, 0);
                    retVal[4] = new Vector3D(0, 1, 0);

                    #endregion
                    break;

                case ThrusterType.Two_Two_Two:
                    #region Two_Two_Two

                    // Directions
                    retVal = new Vector3D[6];
                    retVal[0] = new Vector3D(0, 0, 1);
                    retVal[1] = new Vector3D(0, 0, -1);
                    retVal[2] = new Vector3D(1, 0, 0);
                    retVal[3] = new Vector3D(-1, 0, 0);
                    retVal[4] = new Vector3D(0, 1, 0);
                    retVal[5] = new Vector3D(0, -1, 0);

                    #endregion
                    break;

                case ThrusterType.Custom:
                    #region Custom

                    throw new ApplicationException("finish implementing custom thrusters");

                    #endregion
                    break;

                default:
                    throw new ApplicationException("Unknown ThrusterType: " + thrusterType.ToString());
            }

            // Exit Function
            return retVal;
        }
Ejemplo n.º 4
0
        public ThrusterDesign(EditorOptions options, bool isFinalModel, ThrusterType thrusterType)
            : base(options, isFinalModel)
        {
            if (thrusterType == ThrusterType.Custom)
            {
                throw new ArgumentException("This overload doesn't allow a ThrusterType of Custom");
            }

            this.ThrusterType = thrusterType;
            this.ThrusterDirections = GetThrusterDirections(this.ThrusterType);
        }
Ejemplo n.º 5
0
 public ThrusterMsg(bool activate , ThrusterType type)
 {
     this.activate = activate;
     this.type = type;
 }
Ejemplo n.º 6
0
 public ThrusterMsg(bool activate, ThrusterType type)
 {
     this.activate = activate;
     this.type     = type;
 }