Exemplo n.º 1
0
        public void PositionSettings_constructor_tests()
        {
            StrategyHeader strategyHeader = new StrategyHeader(1, "Strategy sample", "BP12345-RF-01", "RTS-12.13_FT", 1);

            PositionSettings ps = new PositionSettings(strategyHeader, PositionType.Long);

            Assert.AreEqual(strategyHeader.Id, ps.Id);
            Assert.AreEqual(strategyHeader.Id, ps.StrategyId);
            Assert.AreEqual(strategyHeader, ps.Strategy);
            Assert.AreEqual(PositionType.Long, ps.PositionType);
        }
        public static Vector3 GetRandomPosition(PositionSettings settings)
        {
            var y = Random.Range(settings.MinHeight, settings.MaxHeight);

            var angle  = Random.Range(0f, 2 * Mathf.PI);
            var radius = Random.Range(settings.MinRadius, settings.MaxRadius);

            var x = Mathf.Cos(angle) * radius;
            var z = Mathf.Sin(angle) * radius;

            return(new Vector3(x, y, z) + settings.Offset);
        }
Exemplo n.º 3
0
        public bool SavePositionSettings(PositionSettings newPositionSettings)
        {
            var newInstance = new Config(this.Instance.Locations, this.Instance.Services, this.Instance.WindowLayout, this.Instance.RouterSettings, this.Instance.MainLayout, newPositionSettings);

            return(SaveInternal(newInstance, false));
        }