Update code to support new inspectcode analysis rules

This commit is contained in:
Dean Herbert
2017-09-14 12:58:32 +09:00
parent 0ca60eaecc
commit b1145272d1
12 changed files with 23 additions and 12 deletions

View File

@ -1,8 +1,10 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Linq;
using System.Collections.Generic;
using System.Diagnostics;
using osu.Game.Rulesets.Objects.Types;
using osu.Game.Rulesets.Objects;
@ -34,10 +36,12 @@ namespace osu.Game.Screens.Play
foreach (var h in objects)
{
IHasEndTime end = h as IHasEndTime;
var endTime = Math.Max((h as IHasEndTime)?.EndTime ?? h.StartTime, h.StartTime);
Debug.Assert(endTime > h.StartTime);
int startRange = (int)((h.StartTime - firstHit) / interval);
int endRange = (int)(((end?.EndTime > 0 ? end.EndTime : h.StartTime) - firstHit) / interval);
int endRange = (int)((endTime - firstHit) / interval);
for (int i = startRange; i <= endRange; i++)
Values[i]++;
}