public void Setup()
        {
            //Instance Fields Setup
            BooleanField = null;
            ByteField = null;
            SByteField = null;
            IntField = null;
            LongField = null;
            Int16Field = null;
            UInt16Field = null;
            Int32Field = null;
            UInt32Field = null;
            Int64Field = null;
            UInt64Field = null;
            CharField = null;
            DoubleField = null;
            FloatField = null;

            //Static Fields Setup
            BooleanFieldStatic = null;
            ByteFieldStatic = null;
            SByteFieldStatic = null;
            IntFieldStatic = null;
            LongFieldStatic = null;
            Int16FieldStatic = null;
            UInt16FieldStatic = null;
            Int32FieldStatic = null;
            UInt32FieldStatic = null;
            Int64FieldStatic = null;
            UInt64FieldStatic = null;
            CharFieldStatic = null;
            DoubleFieldStatic = null;
            FloatFieldStatic = null;
        }
Beispiel #2
0
        public static void UpdateNavballScale(float navballScale)
        {
            References.Instance.ScreenSafeUi.centerAnchor.bottom.localScale = new Vector3(
                navballScale,
                navballScale,
                navballScale);

            var navBallBurnVector = References.Instance.NavBallBurnVector;

            if (_maneuverVectorScaleDefault.HasValue == false)
                _maneuverVectorScaleDefault = navBallBurnVector.readoutSpacing;

            var scale = navballScale * _maneuverVectorScaleDefault.Value;
            navBallBurnVector.readoutSpacing = scale;

            var navBall = References.Instance.Navball;

            if (_navballTextSizeDefault.HasValue == false)
                _navballTextSizeDefault = navBall.headingText.textSize;

            var flightUiController = References.Instance.FlightUIController;

            scale = navballScale * _navballTextSizeDefault.Value;
            navBall.headingText.textSize = scale;
            navBallBurnVector.ebtText.textSize = scale;
            navBallBurnVector.TdnText.textSize = scale;
            flightUiController.speed.textSize = scale;
            flightUiController.spdCaption.textSize = scale;
        }
 public override void Parse(GameBitBuffer buffer)
 {
     Field0 = buffer.ReadInt(32);
     if (buffer.ReadBool())
     {
         Field1 = new Vector3D();
         Field1.Parse(buffer);
     }
     if (buffer.ReadBool())
     {
         Field2 = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         Field3 = buffer.ReadBool();
     }
     if (buffer.ReadBool())
     {
         Field4 = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         Field5 = buffer.ReadInt(24);
     }
     if (buffer.ReadBool())
     {
         Field6 = buffer.ReadInt(21) + (-1);
     }
     if (buffer.ReadBool())
     {
         Field7 = buffer.ReadInt(32);
     }
 }
        private void Tick(object sender, TimerTickEventArgs e)
        {
            if (_ledTimeout.IsRunning)
            {
                _ledTimeout.Tick(e.ElapsedTime);
                if (_ledTimeout.IsElapsed)
                {
                    ToggleStatusLed();
                }
            }

            _durations.Add((int)e.ElapsedTime.TotalMilliseconds);
            if (_durations.Count == _durations.Capacity)
            {
                _averageTimerDuration = _durations.Sum() / (float)_durations.Count;
                _durations.Clear();

                if (!_maxTimerDuration.HasValue || _averageTimerDuration > _maxTimerDuration.Value)
                {
                    _maxTimerDuration = _averageTimerDuration;
                }

                if (!_minTimerDuration.HasValue || _averageTimerDuration < _minTimerDuration.Value)
                {
                    _minTimerDuration = _averageTimerDuration;
                }
            }
        }
Beispiel #5
0
        internal FirebasePriority(JValue priority)
        {
            if (priority == null || priority.Type == JTokenType.Null)
            {
                Type = PriorityType.None;
                return;
            }

            switch (priority.Type)
            {
                case JTokenType.None:
                    Type = PriorityType.None;
                    return;
                case JTokenType.Integer:
                case JTokenType.Float:
                    Type = PriorityType.Numeric;
                    _fp = priority.Value<float>();
                    return;
                case JTokenType.String:
                    int value;
                    if (int.TryParse(priority.Value<string>(), out value))
                    {
                        Type = PriorityType.Numeric;
                        _fp = value;
                    }
                    else
                    {
                        Type = PriorityType.String;
                        _sp = priority.Value<string>();
                    }
                    return;
                default:
                    throw new Exception(string.Format("Unable to load priority of type: {0}", priority.Type));
            }
        }
        public override void Draw()
        {
            float powerScaleBy = 100;
            var maxPower = Math.Max(pm.PowerProvided, pm.PowerDrained);
            while (maxPower >= powerScaleBy) powerScaleBy *= 2;

            // Current power supply
            var providedFrac = pm.PowerProvided / powerScaleBy;
            lastProvidedFrac = providedFrac = float2.Lerp(lastProvidedFrac.GetValueOrDefault(providedFrac), providedFrac, .3f);

            var color = Color.LimeGreen;
            if (pm.PowerState == PowerState.Low)
                color = Color.Orange;
            if (pm.PowerState == PowerState.Critical)
                color = Color.Red;

            var b = RenderBounds;
            var rect = new RectangleF(b.X,
                                      b.Y + (1-providedFrac)*b.Height,
                                      (float)b.Width,
                                      providedFrac*b.Height);
            Game.Renderer.LineRenderer.FillRect(rect, color);

            var indicator = ChromeProvider.GetImage("sidebar-bits", "left-indicator");

            var drainedFrac = pm.PowerDrained / powerScaleBy;
            lastDrainedFrac = drainedFrac = float2.Lerp(lastDrainedFrac.GetValueOrDefault(drainedFrac), drainedFrac, .3f);

            float2 pos = new float2(b.X + b.Width - indicator.size.X,
                                    b.Y + (1-drainedFrac)*b.Height - indicator.size.Y / 2);

            Game.Renderer.RgbaSpriteRenderer.DrawSprite(indicator, pos);
        }
 public Line(float x1, float y1, float x2, float y2)
 {
     p1 = new Point(x1, y1);
     p2 = new Point(x2, y2);
     _length = -1;
     _angle = null;
 }
        public Guid IngredientId; // KPC Shopping Ingredient ID

        #endregion Fields

        #region Constructors

        public PantryItem(Ingredients.IngredientUsage usage)
        {
            this.IngredientId = usage.Ingredient.Id;

            // Need to convert IngredientUsage into proper Pantry form
            if (usage.Amount != null)
            {
                var toUnit = Unit.GetDefaultUnitType(usage.Ingredient.ConversionType);
                if (UnitConverter.CanConvert(usage.Form.FormUnitType, toUnit))
                {
                    // Always take high amount for pantry items
                    this.Amount = UnitConverter.Convert(usage.Amount, toUnit).SizeHigh;
                }
                else
                {
                    // Find conversion path
                    var amount = FormConversion.GetNativeAmountForUsage(usage.Ingredient, usage);

                    // Always take high amount for pantry items
                    this.Amount = UnitConverter.Convert(amount, toUnit).SizeHigh;
                }
            }
            else
            {
                this.Amount = null;
            }
        }
Beispiel #9
0
 public void targetAngleEventHandler(object sender, TargetAngleArgs e)
 {
     if (e.identifer == identifier)
     {
         targetPosition = e.angle;
     }
 }
 public Line(Point p1, Point p2)
 {
     this.p1 = p1;
     this.p2 = p2;
     _length = -1;
     _angle = null;
 }
 public override void Parse(GameBitBuffer buffer)
 {
     ActorId = buffer.ReadInt(32);
     if (buffer.ReadBool())
     {
         Position = new Vector3D();
         Position.Parse(buffer);
     }
     if (buffer.ReadBool())
     {
         Angle = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         TurnImmediately = buffer.ReadBool();
     }
     if (buffer.ReadBool())
     {
         Speed = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         Field5 = buffer.ReadInt(25);
     }
     if (buffer.ReadBool())
     {
         AnimationTag = buffer.ReadInt(21) + (-1);
     }
     if (buffer.ReadBool())
     {
         Field7 = buffer.ReadInt(32);
     }
 }
        public void AddNullableFloatTest() {
            var leftSequence = new float?[] { 1, 2, 3, 4, 5 };
            var rightSequence = new float?[] { 1, 2, 3, 4, 5 };
            var expected = new float?[] { 2, 4, 6, 8, 10 };

            var actual = LinqTool.Add(leftSequence, rightSequence);
            Assert.IsTrue(expected.SequenceEqual(actual));

            //------------------------------//

            leftSequence = new float?[] { 1, 2, 3, float.NaN, float.PositiveInfinity };
            rightSequence = new float?[] { 1, 2, 3, 4, 5 };
            expected = new float?[] { 2, 4, 6, float.NaN, float.PositiveInfinity };

            actual = LinqTool.Add(leftSequence, rightSequence);
            Assert.IsTrue(expected.SequenceEqual(actual));

            //------------------------------//

            leftSequence = new float?[] { 1, null, 3, float.NaN, float.PositiveInfinity };
            rightSequence = new float?[] { 1, 2, 3, 4, 5 };
            expected = new float?[] { 2, null, 6, float.NaN, float.PositiveInfinity };

            actual = LinqTool.Add(leftSequence, rightSequence);
            Assert.IsTrue(expected.SequenceEqual(actual));
        }
Beispiel #13
0
    //Function for single number functions and the clear function.
    void Calculate(string operSym)
    {
        bool error = false;
        switch (operSym){
            case "square":
                firstValue = Mathf.Pow((float)firstValue,2f);
                break;
            case "squareRoot":
                firstValue = Mathf.Pow((float)firstValue,0.5f);
                break;
            case "clr":
                firstValue = null;
                secondValue = null;
                break;
            case "":
                break;
            default:
                error = true;
                break;
        }

        //In case something breaks
        if(error){
            displayText = "ERROR";
            error = false;
        }
        else
            displayText = firstValue + "";
            tempValue = firstValue;						//so that the store variable button works and I don't have to change how the input function works
    }
    void Start()
    {
        menuButton = null;
        dragMenuButton = null;

        XmlElement unityElem = getReal3D.Plugin.getApplicationConfigXml();
        if(unityElem == null) {
            return;
        }

        XmlNodeList menus = unityElem.GetElementsByTagName("menu");
        if(menus.Count == 0) {
            return;
        }

        XmlElement menu = menus.Item(0) as XmlElement;

        width = readFromAttribute(menu, "width");
        depth = readFromAttribute(menu, "depth");
        maxRotationSpeed = readFromAttribute(menu, "max_rotation_speed");
        maxTranslationSpeed = readFromAttribute(menu, "max_translation_speed");
        menuButton = readStringFromAttribute(menu, "button");
        dragMenuButton = readStringFromAttribute(menu, "drag_button");

        if(menuButton != null) {
            WandEventModule wandEventModule = FindObjectOfType(typeof(WandEventModule)) as WandEventModule;
            wandEventModule.submitButtonName = menuButton;
        }
    }
Beispiel #15
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rbEnterManually.Checked)
            {
                SelectedWaveLength = (float)nudManualWavelength.Value;
            }
            else if (rbPickFromList.Checked)
            {
                if (lvFraunhoferLines.SelectedItems.Count != 1)
                {
                    MessageBox.Show("Please select a line", "Tangra", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                SelectedWaveLength = float.Parse(lvFraunhoferLines.SelectedItems[0].SubItems[2].Text, CultureInfo.InvariantCulture);
            }

            m_State.CalibrationPointSelected(SelectedWaveLength, cbxCalibrate.Checked, (int)nudPolyOrder.Value);

            if (cbxSinglePoint.Checked)
            {
                SelectedDispersion = (float) nudDispersion.Value;
                m_State.DispersionSelected(SelectedDispersion.Value);
            }

            Close();
        }
Beispiel #16
0
 public frmEnterWavelength(SpectraViewerStateCalibrate state)
     : this()
 {
     m_State = state;
     SelectedWaveLength = float.NaN;
     SelectedDispersion = null;
 }
 public NullableVector4()
 {
     X = null;
     Y = null;
     Z = null;
     W = null;
 }
Beispiel #18
0
 public Battery(string model, BatteryType type)
 {
     this.Model = model;
     this.type = type;
     this.hoursIdle = null;
     this.hoursTalk = null;
 }
Beispiel #19
0
        public override void Draw()
        {
            float scaleBy = 100;
            var max = Math.Max(pr.OreCapacity, pr.Ore);
            while (max >= scaleBy) scaleBy *= 2;

            // Current capacity
            var capacityFrac = pr.OreCapacity / scaleBy;
            lastCapacityFrac = capacityFrac = float2.Lerp(lastCapacityFrac.GetValueOrDefault(capacityFrac), capacityFrac, .3f);

            var color = GetBarColor();

            var b = RenderBounds;
            var rect = new RectangleF(b.X, float2.Lerp( b.Bottom, b.Top, capacityFrac ),
                (float)b.Width, capacityFrac*b.Height);
            Game.Renderer.LineRenderer.FillRect(rect, color);

            var indicator = ChromeProvider.GetImage("sidebar-bits", "right-indicator");

            var storedFrac = pr.Ore / scaleBy;
            lastStoredFrac = storedFrac = float2.Lerp(lastStoredFrac.GetValueOrDefault(storedFrac), storedFrac, .3f);

            float2 pos = new float2(b.X, float2.Lerp( b.Bottom, b.Top, storedFrac ) - indicator.size.Y / 2);

            Game.Renderer.RgbaSpriteRenderer.DrawSprite(indicator, pos);
        }
    private void PlaySound(AudioEvent aEvent)
    {
        if (!this.disableSounds)
        {
            float volume = aEvent.volume;
            string soundType = aEvent.soundType;
            float? pitch = new float?(aEvent.pitch);
            if (!aEvent.useFixedPitch)
            {
                pitch = null;
            }
            PlaySoundResult result = null;
            switch (this.soundSpawnMode)
            {
                case MasterAudio.SoundSpawnLocationMode.MasterAudioLocation:
                    result = MasterAudio.PlaySound(soundType, volume, null, 0f, null, false);
                    break;

                case MasterAudio.SoundSpawnLocationMode.CallerLocation:
                    result = MasterAudio.PlaySound3DAtTransform(soundType, this.trans, volume, pitch, 0f, null, false);
                    break;

                case MasterAudio.SoundSpawnLocationMode.AttachToCaller:
                    result = MasterAudio.PlaySound3DFollowTransform(soundType, this.trans, volume, pitch, 0f, null, false);
                    break;
            }
            if (((result != null) && result.SoundPlayed) && aEvent.emitParticles)
            {
                MasterAudio.TriggerParticleEmission(this.trans, aEvent.particleCountToEmit);
            }
        }
    }
        public ShooterInstructions getShooterInstructions(GameTime gameTime, Shooter shooter)
        {
            if (targetPosition == null)
            {
                targetPosition = calculateTargetAngle(gameTime, shooter);
                currentWait = AiWait;
                Debug.Assert(targetPosition <= Shooter.MAX_ROTATION && targetPosition >= Shooter.MIN_ROTATION, "Target Angle must be between the clamp values impossed by the shooter class");
            }

            if (shooter.aimingAngle == targetPosition)
            {
                if (currentWait > TimeSpan.Zero)
                {
                    currentWait -= gameTime.ElapsedGameTime;
                    return new ShooterInstructions(0.0f, false);
                }
                else
                {
                    targetPosition = null;
                    return new ShooterInstructions(0.0f, true);
                }
            }
            else
            {
                return ShooterControllerHelper.towardsTargetAngle((float)targetPosition, shooter.aimingAngle);
            }
        }
Beispiel #22
0
 /// <summary>
 /// Creates an animation of types int, double or float.  
 /// </summary>
 /// <param name="from">The starting position.</param>
 /// <param name="to">The ending position.</param>
 /// <param name="duration">The time it takes to get from start to end.</param>
 public Animation(float from, float to, TimeSpan duration)
 {
     stopwatch = new Stopwatch();
     this.current = this.from = from;
     this.to = to;
     this.duration = duration;
 }
Beispiel #23
0
 public override void Parse(GameBitBuffer buffer)
 {
     ActorId = buffer.ReadInt(32);
     if (buffer.ReadBool())
     {
         Position = new Vector3D();
         Position.Parse(buffer);
     }
     if (buffer.ReadBool())
     {
         Angle = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         Field3 = buffer.ReadBool();
     }
     if (buffer.ReadBool())
     {
         Field4 = buffer.ReadFloat32();
     }
     if (buffer.ReadBool())
     {
         Field5 = buffer.ReadInt(24);
     }
     if (buffer.ReadBool())
     {
         Field6 = buffer.ReadInt(21) + (-1);
     }
     if (buffer.ReadBool())
     {
         Field7 = buffer.ReadInt(32);
     }
 }
        public RParentChild( LinksDataSet dsLinks, LinksDataSet.tblRelatedStructureRow drLeft )
        {
            //ImportDataSet dsImport, , LinksDataSet.tblRelatedStructureRow drRight
            if ( dsLinks == null ) throw new ArgumentNullException("dsLinks");
            if ( drLeft == null ) throw new ArgumentNullException("drLeft");
            if ( dsLinks.tblSubject.Count == 0 ) throw new InvalidOperationException("tblSubject must NOT be empty before assigning R values from it.");
            _dsLinks = dsLinks;
            _drLeft = drLeft;
            _idRelatedLeft = _drLeft.ID;
            _drBare1 = _dsLinks.tblSubject.FindBySubjectTag(drLeft.SubjectTag_S1);
            _drBare2 = _dsLinks.tblSubject.FindBySubjectTag(drLeft.SubjectTag_S2);
            Trace.Assert(_drBare1.Generation != _drBare2.Generation, "The generation should not be the same for a parent-child relationship.");

            _multipleBirth = MultipleBirth.No;
            _isMZ = Tristate.No;

            //For IAssignPass1
            _rImplicitPass1 = RCoefficients.ParentChild;
            _rImplicit2004 = RCoefficients.ParentChild;
            _rExplicitOldestSibVersion = null;
            _rExplicitYoungestSibVersion = null;
            _rExplicitPass1 = RCoefficients.ParentChild;
            _rPass1 = RCoefficients.ParentChild;

            //For IAssignPass2
            _rImplicit = RCoefficients.ParentChild;
            _rImplicitSubject = RCoefficients.ParentChild;
            _rImplicitMother = RCoefficients.ParentChild;
            _rExplicit = RCoefficients.ParentChild;
            _rFull = RCoefficients.ParentChild;
            _rPeek = RCoefficients.ParentChild;
        }
 public FermentableCharacteristics(float? yield, float color, float? diastaticPower)
 {
     m_yield = yield;
     m_color = color;
     m_diastaticPower = diastaticPower;
     m_yieldByWeight = null;
 }
 public static void CheckUnaryArithmeticNegateCheckedNullableFloatTest(bool useInterpreter)
 {
     float?[] values = new float?[] { null, 0, 1, -1, float.MinValue, float.MaxValue, float.Epsilon, float.NegativeInfinity, float.PositiveInfinity, float.NaN };
     for (int i = 0; i < values.Length; i++)
     {
         VerifyArithmeticNegateCheckedNullableFloat(values[i], useInterpreter);
     }
 }
Beispiel #27
0
        public override void PopulateFromXElement(XElement element)
        {
            base.PopulateFromXElement(element);
            XNamespace xmlns = element.Name.Namespace;

            BorderColor = element.Attribute("color").NullableColor();
            Width = element.Attribute("width").NullableFloat();
        }
Beispiel #28
0
 public void RestoreScreenDefaults()
 {
     ShouldFollowActivePlayer = false;
     ActivePlayerXOffset = 3f;
     TargetPosition = null;
     TargetSize = null;
     TimeToMove = 0.5f;
 }
 public static void CheckIncrementFloatTest()
 {
     float?[] values = new float?[] { null, 0, 1, -1, float.MinValue, float.MaxValue, float.Epsilon, float.NegativeInfinity, float.PositiveInfinity, float.NaN };
     for (int i = 0; i < values.Length; i++)
     {
         VerifyIncrementNullableFloat(values[i]);
     }
 }
 public void CumulativeMovingAverageNullableFloatTest() {
     var source = new float?[] { 1, 2, null, null, 3, 4, 5, 6, 7, 8, 9, float.NaN, 11, 12, 13 };
     var expected = new float?[] { 1, 1.5f, 2, 2.5f, 3, 3.5f, 4, 4.5f, 5, float.NaN, float.NaN, float.NaN, float.NaN };
     var actual = source.CumulativeMovingAverage().ToList();
     if(IsDebugEnabled)
         log.Debug(@"expected=[{0}], actual=[{1}]", expected.CollectionToString(), actual.CollectionToString());
     Assert.IsTrue(expected.SequenceEqual(actual));
 }
Beispiel #31
0
 /// <summary>
 /// Set CustomWheelsize field
 /// Units: m</summary>
 /// <param name="customWheelsize_">Nullable field value to be set</param>
 public void SetCustomWheelsize(float?customWheelsize_)
 {
     SetFieldValue(8, 0, customWheelsize_, Fit.SubfieldIndexMainField);
 }
Beispiel #32
0
 public ReporteViewModel(string nombreView, string apellidoView, int codigoView, DateTime?fechaView, float?montoTotalView)
 {
     this.nombreView     = nombreView;
     this.apellidoView   = apellidoView;
     this.codigoView     = codigoView;
     this.fechaView      = fechaView;
     this.montoTotalView = montoTotalView;
 }
Beispiel #33
0
        public static async Task ScrollToElementAsync(this ScrollViewer scrollViewer, FrameworkElement element,
                                                      bool isVerticalScrolling = true, bool smoothScrolling = true, float?zoomFactor = null, bool bringToTopOrLeft = true)
        {
            if (!bringToTopOrLeft && element.IsFullyVisibile(scrollViewer))
            {
                return;
            }

            var contentArea = (FrameworkElement)scrollViewer.Content;
            var position    = element.RelativePosition(contentArea);

            if (isVerticalScrolling)
            {
                await scrollViewer.ChangeViewAsync(null, position.Y, zoomFactor, !smoothScrolling);
            }
            else
            {
                await scrollViewer.ChangeViewAsync(position.X, null, zoomFactor, !smoothScrolling);
            }
        }
 /// <inheritdoc cref="ThermalResistance.FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(double?)"/>
 public static ThermalResistance?SquareCentimeterHourDegreesCelsiusPerKilocalorie(this float?value) => ThermalResistance.FromSquareCentimeterHourDegreesCelsiusPerKilocalorie(value);
 /// <inheritdoc cref="ThermalResistance.FromSquareMeterDegreesCelsiusPerWatt(double?)"/>
 public static ThermalResistance?SquareMeterDegreesCelsiusPerWatt(this float?value) => ThermalResistance.FromSquareMeterDegreesCelsiusPerWatt(value);
Beispiel #36
0
 public ItemSpawnInfo(ItemPrefab prefab, Vector2 position, Submarine sub, Action <Item> onSpawned, float?condition = null)
 {
     Prefab         = prefab ?? throw new ArgumentException("ItemSpawnInfo prefab cannot be null.");
     Position       = position;
     Submarine      = sub;
     Condition      = condition ?? prefab.Health;
     this.onSpawned = onSpawned;
 }
Beispiel #37
0
 public void AddToSpawnQueue(ItemPrefab itemPrefab, Vector2 position, Submarine sub, float?condition = null, Action <Item> onSpawned = null)
 {
     if (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient)
     {
         return;
     }
     if (itemPrefab == null)
     {
         string errorMsg = "Attempted to add a null item to entity spawn queue.\n" + Environment.StackTrace.CleanupStackTrace();
         DebugConsole.ThrowError(errorMsg);
         GameAnalyticsManager.AddErrorEventOnce("EntitySpawner.AddToSpawnQueue2:ItemPrefabNull", GameAnalyticsSDK.Net.EGAErrorSeverity.Error, errorMsg);
         return;
     }
     spawnQueue.Enqueue(new ItemSpawnInfo(itemPrefab, position, sub, onSpawned, condition));
 }
Beispiel #38
0
 public PlaySoundParams(string _soundType, float _volPercent, float _groupCalcVolume, float?_pitch, Transform _sourceTrans, bool _attach, float _delaySoundTime, bool _isChainLoop)
 {
     soundType        = _soundType;
     volumePercentage = _volPercent;
     groupCalcVolume  = _groupCalcVolume;
     pitch            = _pitch;
     sourceTrans      = _sourceTrans;
     attachToSource   = _attach;
     delaySoundTime   = _delaySoundTime;
     isChainLoop      = _isChainLoop;
 }
Beispiel #39
0
        public ResponseProfile GetVideoMediaProfile(string container,
                                                    string audioCodec,
                                                    string videoCodec,
                                                    int?width,
                                                    int?height,
                                                    int?bitDepth,
                                                    int?videoBitrate,
                                                    string videoProfile,
                                                    double?videoLevel,
                                                    float?videoFramerate,
                                                    int?packetLength,
                                                    TransportStreamTimestamp timestamp,
                                                    bool?isAnamorphic,
                                                    bool?isInterlaced,
                                                    int?refFrames,
                                                    int?numVideoStreams,
                                                    int?numAudioStreams,
                                                    string videoCodecTag,
                                                    bool?isAvc)
        {
            foreach (var i in ResponseProfiles)
            {
                if (i.Type != DlnaProfileType.Video)
                {
                    continue;
                }

                if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
                {
                    continue;
                }

                var audioCodecs = i.GetAudioCodecs();
                if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
                {
                    continue;
                }

                var videoCodecs = i.GetVideoCodecs();
                if (videoCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
                {
                    continue;
                }

                var conditionProcessor = new ConditionProcessor();

                var anyOff = false;
                foreach (ProfileCondition c in i.Conditions)
                {
                    if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, isInterlaced, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
                    {
                        anyOff = true;
                        break;
                    }
                }

                if (anyOff)
                {
                    continue;
                }

                return(i);
            }
            return(null);
        }
Beispiel #40
0
 /// <summary>
 /// Set BikeWeight field
 /// Units: kg</summary>
 /// <param name="bikeWeight_">Nullable field value to be set</param>
 public void SetBikeWeight(float?bikeWeight_)
 {
     SetFieldValue(10, 0, bikeWeight_, Fit.SubfieldIndexMainField);
 }
Beispiel #41
0
 /// <summary>
 /// Set AutoWheelsize field
 /// Units: m</summary>
 /// <param name="autoWheelsize_">Nullable field value to be set</param>
 public void SetAutoWheelsize(float?autoWheelsize_)
 {
     SetFieldValue(9, 0, autoWheelsize_, Fit.SubfieldIndexMainField);
 }
Beispiel #42
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GetUniverseSystemsSystemIdOk" /> class.
 /// </summary>
 /// <param name="constellationId">The constellation this solar system is in (required).</param>
 /// <param name="name">name string (required).</param>
 /// <param name="planets">planets array (required).</param>
 /// <param name="position">position (required).</param>
 /// <param name="securityClass">security_class string.</param>
 /// <param name="securityStatus">security_status number (required).</param>
 /// <param name="starId">star_id integer (required).</param>
 /// <param name="stargates">stargates array.</param>
 /// <param name="stations">stations array.</param>
 /// <param name="systemId">system_id integer (required).</param>
 public GetUniverseSystemsSystemIdOk(int?constellationId = default(int?), string name = default(string), List <GetUniverseSystemsSystemIdPlanet> planets = default(List <GetUniverseSystemsSystemIdPlanet>), GetUniverseSystemsSystemIdPosition position = default(GetUniverseSystemsSystemIdPosition), string securityClass = default(string), float?securityStatus = default(float?), int?starId = default(int?), List <int?> stargates = default(List <int?>), List <int?> stations = default(List <int?>), int?systemId = default(int?))
 {
     // to ensure "constellationId" is required (not null)
     if (constellationId == null)
     {
         throw new InvalidDataException("constellationId is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.ConstellationId = constellationId;
     }
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "planets" is required (not null)
     if (planets == null)
     {
         throw new InvalidDataException("planets is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.Planets = planets;
     }
     // to ensure "position" is required (not null)
     if (position == null)
     {
         throw new InvalidDataException("position is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.Position = position;
     }
     // to ensure "securityStatus" is required (not null)
     if (securityStatus == null)
     {
         throw new InvalidDataException("securityStatus is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.SecurityStatus = securityStatus;
     }
     // to ensure "starId" is required (not null)
     if (starId == null)
     {
         throw new InvalidDataException("starId is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.StarId = starId;
     }
     // to ensure "systemId" is required (not null)
     if (systemId == null)
     {
         throw new InvalidDataException("systemId is a required property for GetUniverseSystemsSystemIdOk and cannot be null");
     }
     else
     {
         this.SystemId = systemId;
     }
     this.SecurityClass = securityClass;
     this.Stargates     = stargates;
     this.Stations      = stations;
 }
 /// <inheritdoc cref="ThermalResistance.FromHourSquareFeetDegreesFahrenheitPerBtu(double?)"/>
 public static ThermalResistance?HourSquareFeetDegreesFahrenheitPerBtu(this float?value) => ThermalResistance.FromHourSquareFeetDegreesFahrenheitPerBtu(value);
Beispiel #44
0
 public ItemSpawnInfo(ItemPrefab prefab, Inventory inventory, Action <Item> onSpawned, float?condition = null)
 {
     Prefab         = prefab ?? throw new ArgumentException("ItemSpawnInfo prefab cannot be null.");
     Inventory      = inventory;
     Condition      = condition ?? prefab.Health;
     this.onSpawned = onSpawned;
 }
 /// <inheritdoc cref="ThermalResistance.FromSquareMeterKelvinsPerKilowatt(double?)"/>
 public static ThermalResistance?SquareMeterKelvinsPerKilowatt(this float?value) => ThermalResistance.FromSquareMeterKelvinsPerKilowatt(value);
Beispiel #46
0
    private float SetValue(string text)
    {
        float?value = GetParamValue(text);

        return((value != null) ? (float)value : 0f);
    }
 /// <inheritdoc cref="ThermalResistance.FromSquareCentimeterKelvinsPerWatt(double?)"/>
 public static ThermalResistance?SquareCentimeterKelvinsPerWatt(this float?value) => ThermalResistance.FromSquareCentimeterKelvinsPerWatt(value);
Beispiel #48
0
        private static void Postfix(NoteController __instance, NoteData noteData, NoteMovement ____noteMovement, Vector3 moveStartPos, Vector3 moveEndPos, Vector3 jumpEndPos)
        {
            if (noteData is CustomNoteData customData)
            {
                dynamic dynData = customData.customData;

                float?cutDir = (float?)Trees.at(dynData, CUTDIRECTION);

                NoteJump          noteJump      = _noteJumpAccessor(ref ____noteMovement);
                NoteFloorMovement floorMovement = _noteFloorMovementAccessor(ref ____noteMovement);

                if (cutDir.HasValue)
                {
                    Quaternion cutQuaternion = Quaternion.Euler(0, 0, cutDir.Value);
                    _endRotationAccessor(ref noteJump) = cutQuaternion;
                    Vector3 vector = cutQuaternion.eulerAngles;
                    vector += _randomRotationsAccessor(ref noteJump)[_randomRotationIdxAccessor(ref noteJump)] * 20;
                    Quaternion midrotation = Quaternion.Euler(vector);
                    _middleRotationAccessor(ref noteJump) = midrotation;
                }

                dynamic             rotation = Trees.at(dynData, ROTATION);
                IEnumerable <float> localrot = ((List <object>)Trees.at(dynData, LOCALROTATION))?.Select(n => Convert.ToSingle(n));

                Transform transform = __instance.transform;

                Quaternion localRotation = _quaternionIdentity;
                if (rotation != null || localRotation != null)
                {
                    if (localrot != null)
                    {
                        localRotation = Quaternion.Euler(localrot.ElementAt(0), localrot.ElementAt(1), localrot.ElementAt(2));
                    }

                    Quaternion worldRotationQuatnerion;
                    if (rotation != null)
                    {
                        if (rotation is List <object> list)
                        {
                            IEnumerable <float> rot = list?.Select(n => Convert.ToSingle(n));
                            worldRotationQuatnerion = Quaternion.Euler(rot.ElementAt(0), rot.ElementAt(1), rot.ElementAt(2));
                        }
                        else
                        {
                            worldRotationQuatnerion = Quaternion.Euler(0, (float)rotation, 0);
                        }

                        Quaternion inverseWorldRotation = Quaternion.Euler(-worldRotationQuatnerion.eulerAngles);
                        _worldRotationJumpAccessor(ref noteJump)              = worldRotationQuatnerion;
                        _inverseWorldRotationJumpAccessor(ref noteJump)       = inverseWorldRotation;
                        _worldRotationFloorAccessor(ref floorMovement)        = worldRotationQuatnerion;
                        _inverseWorldRotationFloorAccessor(ref floorMovement) = inverseWorldRotation;

                        worldRotationQuatnerion *= localRotation;

                        transform.localRotation = worldRotationQuatnerion;
                    }
                    else
                    {
                        transform.localRotation *= localRotation;
                    }
                }

                transform.localScale = Vector3.one; // This is a fix for animation due to notes being recycled

                Track track = AnimationHelper.GetTrack(dynData);
                if (track != null && ParentObject.Controller != null)
                {
                    ParentObject parentObject = ParentObject.Controller.GetParentObjectTrack(track);
                    if (parentObject != null)
                    {
                        parentObject.ParentToObject(transform);
                    }
                    else
                    {
                        ParentObject.ResetTransformParent(transform);
                    }
                }
                else
                {
                    ParentObject.ResetTransformParent(transform);
                }

                dynData.moveStartPos  = moveStartPos;
                dynData.moveEndPos    = moveEndPos;
                dynData.jumpEndPos    = jumpEndPos;
                dynData.worldRotation = __instance.worldRotation;
                dynData.localRotation = localRotation;
            }

            if (__instance is GameNoteController)
            {
                _gameNoteControllerUpdate.Invoke(__instance, null);
            }
            else
            {
                _noteControllerUpdate.Invoke(__instance, null);
            }
        }
Beispiel #49
0
        public static void ScrollToElement(this ScrollViewer scrollViewer, UIElement element,
                                           bool isVerticalScrolling = true, bool smoothScrolling = true, float?zoomFactor = null)
        {
            var transform = element.TransformToVisual((UIElement)scrollViewer.Content);
            var position  = transform.TransformPoint(new Point(0, 0));

            if (isVerticalScrolling)
            {
                scrollViewer.ChangeView(null, position.Y, zoomFactor, !smoothScrolling);
            }
            else
            {
                scrollViewer.ChangeView(position.X, null, zoomFactor, !smoothScrolling);
            }
        }
Beispiel #50
0
 private TextColumn(LocalisableString title, SpriteText text, float? minWidth = null)
     : base(title, text, minWidth)
 {
     this.text = text;
 }
Beispiel #51
0
        public static Task ChangeViewAsync(this ScrollViewer scrollViewer, double?horizontalOffset, double?verticalOffset, float?zoomFactor, bool disableAniamtion)
        {
            var taskSource = new TaskCompletionSource <bool>();
            EventHandler <ScrollViewerViewChangedEventArgs> onViewChanged = null;

            onViewChanged = (sender, e) =>
            {
                if (e.IsIntermediate)
                {
                    return;
                }

                scrollViewer.ViewChanged -= onViewChanged;
                taskSource.SetResult(true);
            };

            scrollViewer.ViewChanged += onViewChanged;
            scrollViewer.ChangeView(horizontalOffset, verticalOffset, zoomFactor, disableAniamtion);

            return(taskSource.Task);
        }
Beispiel #52
0
 public TextColumn(LocalisableString title, FontUsage font, float? minWidth = null)
     : this(title, new OsuSpriteText { Font = font }, minWidth)
 {
 }
Beispiel #53
0
 internal float?NumberProperty(string propertyName, ref float?output) => output     = this.NullableProperty <JsonNumber>(propertyName)?.ToFloat() ?? null;
 internal ImageCropperCanvasView(SKBitmap bitmap, float?aspectRatio = null)
 {
     this.bitmap  = bitmap;
     croppingRect = new CroppingRectangle(new SKRect(0, 0, bitmap.Width, bitmap.Height), aspectRatio);
     SetAspectRatio(aspectRatio);
 }
 private void SetAspectRatio(float?aspectRatio = null, bool isFullRect = false)
 {
     this.aspectRatio = aspectRatio;
     croppingRect.SetRect(new SKRect(0, 0, bitmap.Width, bitmap.Height), aspectRatio, isFullRect);
     InvalidateSurface();
 }
Beispiel #56
0
 /// <summary>
 /// Set Odometer field
 /// Units: m</summary>
 /// <param name="odometer_">Nullable field value to be set</param>
 public void SetOdometer(float?odometer_)
 {
     SetFieldValue(3, 0, odometer_, Fit.SubfieldIndexMainField);
 }
Beispiel #57
0
 private void ResetProperties()
 {
     position          = null;
     boundaryRadius    = null;
     nextDiscontinuity = null;
 }
Beispiel #58
0
        public bool IsVideoConditionSatisfied(ProfileCondition condition,
                                              int?width,
                                              int?height,
                                              int?bitDepth,
                                              int?videoBitrate,
                                              string videoProfile,
                                              double?videoLevel,
                                              float?videoFramerate,
                                              int?packetLength,
                                              TransportStreamTimestamp?timestamp,
                                              bool?isAnamorphic,
                                              int?refFrames,
                                              int?numVideoStreams,
                                              int?numAudioStreams,
                                              string videoCodecTag,
                                              bool?isAvc)
        {
            switch (condition.Property)
            {
            case ProfileConditionValue.IsAnamorphic:
                return(IsConditionSatisfied(condition, isAnamorphic));

            case ProfileConditionValue.IsAvc:
                return(IsConditionSatisfied(condition, isAvc));

            case ProfileConditionValue.VideoFramerate:
                return(IsConditionSatisfied(condition, videoFramerate));

            case ProfileConditionValue.VideoLevel:
                return(IsConditionSatisfied(condition, videoLevel));

            case ProfileConditionValue.VideoProfile:
                return(IsConditionSatisfied(condition, videoProfile));

            case ProfileConditionValue.VideoCodecTag:
                return(IsConditionSatisfied(condition, videoCodecTag));

            case ProfileConditionValue.PacketLength:
                return(IsConditionSatisfied(condition, packetLength));

            case ProfileConditionValue.VideoBitDepth:
                return(IsConditionSatisfied(condition, bitDepth));

            case ProfileConditionValue.VideoBitrate:
                return(IsConditionSatisfied(condition, videoBitrate));

            case ProfileConditionValue.Height:
                return(IsConditionSatisfied(condition, height));

            case ProfileConditionValue.Width:
                return(IsConditionSatisfied(condition, width));

            case ProfileConditionValue.RefFrames:
                return(IsConditionSatisfied(condition, refFrames));

            case ProfileConditionValue.NumAudioStreams:
                return(IsConditionSatisfied(condition, numAudioStreams));

            case ProfileConditionValue.NumVideoStreams:
                return(IsConditionSatisfied(condition, numVideoStreams));

            case ProfileConditionValue.VideoTimestamp:
                return(IsConditionSatisfied(condition, timestamp));

            default:
                return(true);
            }
        }
Beispiel #59
0
 /// <summary>
 /// Set PowerCalFactor field
 /// Units: %</summary>
 /// <param name="powerCalFactor_">Nullable field value to be set</param>
 public void SetPowerCalFactor(float?powerCalFactor_)
 {
     SetFieldValue(11, 0, powerCalFactor_, Fit.SubfieldIndexMainField);
 }
Beispiel #60
0
 /// <summary>
 /// Set CrankLength field
 /// Units: mm</summary>
 /// <param name="crankLength_">Nullable field value to be set</param>
 public void SetCrankLength(float?crankLength_)
 {
     SetFieldValue(19, 0, crankLength_, Fit.SubfieldIndexMainField);
 }