Пример #1
0
 public UpdatingVisualBounds(IBounds base_bounds, int current_left, int top_margin)
 {
     Left   = base_bounds.Left + current_left;
     Top    = base_bounds.Top + top_margin;
     Width  = base_bounds.Width;
     Height = base_bounds.Height;
 }
Пример #2
0
 public BendBounds(Bend b, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     bend        = b;
     note        = n;
     note_bounds = n_bounds;
     info        = v_info;
 }
        public async Task <IEnumerable <ForecastResponseDTO> > Calculate(IBounds bounds, RequestDTO request)
        {
            decimal wideLowerTotal   = request.LumpSumInvestment;
            decimal wideUpperTotal   = request.LumpSumInvestment;
            decimal narrowLowerTotal = request.LumpSumInvestment;
            decimal narrowUpperTotal = request.LumpSumInvestment;
            decimal runningTotal     = request.LumpSumInvestment;

            decimal monthlyWideLowerRate   = GetMonthlyRate(bounds.WideLowerBound);
            decimal monthlyWideUpperRate   = GetMonthlyRate(bounds.WideUpperBound);
            decimal monthlyNarrowLowerRate = GetMonthlyRate(bounds.NarrowLowerBound);
            decimal monthlyNarrowUpperRate = GetMonthlyRate(bounds.NarrowUpperBound);

            var response = new List <ForecastResponseDTO>()
            {
                new ForecastResponseDTO(request.LumpSumInvestment)
            };

            foreach (int year in Enumerable.Range(1, request.InvestmentTermInYears))
            {
                wideLowerTotal   = CalculateAnnualValue(monthlyWideLowerRate, wideLowerTotal, request);
                wideUpperTotal   = CalculateAnnualValue(monthlyWideUpperRate, wideUpperTotal, request);
                narrowLowerTotal = CalculateAnnualValue(monthlyNarrowLowerRate, narrowLowerTotal, request);
                narrowUpperTotal = CalculateAnnualValue(monthlyNarrowUpperRate, narrowUpperTotal, request);
                runningTotal    += request.MonthlyInvestment * 12;

                response.Add(new ForecastResponseDTO(year, runningTotal, wideLowerTotal,
                                                     narrowLowerTotal, wideUpperTotal, narrowUpperTotal));
            }

            return(await Task.FromResult(response));
        }
Пример #4
0
        public static Engine GetEngine(
            IEnumerable <IFighterStats> fighters,
            IBattlefield battlefield,
            IBounds bounds,
            ICollection <IEngineFeature> features,
            IMoveOrder moveOrder,
            IFighterPositionGenerator positionGenerator,
            IWinCondition winCondition,
            IStaleCondition staleCondition,
            int actionsPerRound)
        {
            return(new Engine(
                       cfg =>
            {
                cfg.ActionsPerRound = actionsPerRound;
                cfg.Battlefield = battlefield;
                cfg.Bounds = bounds;
                cfg.Features = features;
                cfg.MoveOrder = moveOrder;
                cfg.PositionGenerator = positionGenerator;
                cfg.WinCondition = winCondition;
                cfg.StaleCondition = staleCondition;

                return cfg;
            }, fighters));
        }
Пример #5
0
 public HOPOBounds(HOPO h, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     hopo        = h;
     note        = n;
     note_bounds = n_bounds;
     info        = v_info;
 }
Пример #6
0
 public TieBounds(Tie t, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     tie         = t;
     note        = n;
     note_bounds = n_bounds;
     info        = v_info;
 }
Пример #7
0
 public VibratoBounds(Vibrato v, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     vibrato     = v;
     note        = n;
     note_bounds = n_bounds;
     info        = v_info;
 }
Пример #8
0
 public SlideBounds(Slide s, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     slide       = s;
     note        = n;
     note_bounds = n_bounds;
     info        = v_info;
 }
Пример #9
0
        public void updateMeasureBounds(MeasureTreeNode measure_node)
        {
            IBounds bounds = measure_node?.Bounds.getBoundsList().FirstOrDefault();

            position.resetPositionToMeasureBeginning(bounds);
            measure_node.updateBounds();
        }
Пример #10
0
 public PinchHarmonicBounds(PinchHarmonic ph, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     pinch_harmonic = ph;
     note           = n;
     note_bounds    = n_bounds;
     info           = v_info;
 }
Пример #11
0
 /// <summary>
 /// Get union of bounds
 /// </summary>
 /// <param name="bounds">Bounds</param>
 /// <returns>Union of bounds</returns>
 public void Merge(IBounds bounds)
 {
     if (bounds != null && bounds.Positions != null)
     {
         Merge(bounds.Positions);
     }
 }
Пример #12
0
 public PalmMuteBounds(PalmMute pm, Note n, IBounds n_bounds, VisualInfo v_info, IDelegate del)
 {
     palm_mute   = pm;
     note        = n;
     note_bounds = n_bounds;
     info        = v_info;
 }
Пример #13
0
 private bool checkSameBar(IBounds bounds)
 {
     if (current_closest is null)
     {
         return(true);
     }
     return(current_closest.Bar < bounds.Bar || current_closest.Right <= bounds.Right);
 }
Пример #14
0
 public override void checkItem(int pos, IBounds bounds)
 {
     if (checkChordBar(bounds))
     {
         Position        = pos + 1;
         current_closest = bounds;
     }
 }
Пример #15
0
 public static void updateBeforeNoteEffectBounds(IBounds effect_bounds, IBounds note_bounds, Note note, VisualInfo info)
 {
     effect_bounds.Left   = note_bounds.Left - info.Dimensions.NoteWidth;
     effect_bounds.Top    = note_bounds.Top;
     effect_bounds.Width  = info.Dimensions.NoteWidth;
     effect_bounds.Height = note_bounds.Height;
     effect_bounds.Bar    = note_bounds.Bar;
 }
Пример #16
0
        public HOPODrawingStrategy(HOPO h, IBounds bounds, VisualInfo v_info, IDelegate del)
        {
            Bounds       = bounds;
            DrawDelegate = del;

            info = v_info;
            hopo = h;
        }
Пример #17
0
        public BendDrawingStrategy(Bend b, IBounds bounds, VisualInfo v_info, IDelegate del)
        {
            Bounds       = bounds;
            DrawDelegate = del;

            info = v_info;
            bend = b;
        }
Пример #18
0
        public PalmMuteDrawingStrategy(PalmMute pm, IBounds bounds, VisualInfo v_info, IDelegate del)
        {
            Bounds       = bounds;
            DrawDelegate = del;

            info      = v_info;
            palm_mute = pm;
        }
Пример #19
0
        public VibratoDrawingStrategy(Vibrato v, IBounds bounds, VisualInfo v_info, IDelegate del)
        {
            Bounds       = bounds;
            DrawDelegate = del;

            info    = v_info;
            vibrato = v;
        }
Пример #20
0
        public SlideDrawingStrategy(Slide s, IBounds bounds, VisualInfo v_info, IDelegate del)
        {
            Bounds       = bounds;
            DrawDelegate = del;

            info  = v_info;
            slide = s;
        }
Пример #21
0
        public TieDrawingStrategy(Tie t, IBounds bounds, VisualInfo v_info, IDelegate del)
        {
            Bounds       = bounds;
            DrawDelegate = del;

            info = v_info;
            tie  = t;
        }
Пример #22
0
 public override void checkItem(int pos, IBounds bounds)
 {
     if (bounds.containsPoint(Point))
     {
         MeasureSet = true;
         Position   = pos;
     }
 }
Пример #23
0
        public bool Includes( IBounds bounds )
        {
            bool visible = false;

            foreach ( Plane plane in planes )
            {
                if ( bounds.Intersects( plane ) != PlaneIntersectionType.Back )
                {
                    visible = true;
                    break;
                }
            }

            return visible;
        }
Пример #24
0
		/// <summary>
		/// Determine if bounding box is contained by frustum
		/// </summary>
		/// <param name="box">Bounding box</param>
		/// <returns>Containment type</returns>
		public ContainmentType Contains( IBounds bounds )
		{
			bool flag = false;

			foreach ( Plane plane in planes )
			{
				switch ( bounds.Intersects( plane ) )
				{
					case PlaneIntersectionType.Back: return ContainmentType.Disjoint;

					case PlaneIntersectionType.Intersecting:
					{
						flag = true;
						break;
					}
				}
			}

			return !flag ? ContainmentType.Contains : ContainmentType.Intersects;
		}
Пример #25
0
 /// <summary>
 /// Get union of bounds
 /// </summary>
 /// <param name="bounds">Bounds</param>
 /// <returns>Union of bounds</returns>
 public void Merge( IBounds bounds )
 {
     if ( bounds != null && bounds.Positions != null ) Merge( bounds.Positions );
 }