예제 #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 );
 }