Update framework (with cached changes) (#5666)

Update framework (with cached changes)
This commit is contained in:
Dean Herbert 2019-08-09 23:47:40 +09:00 committed by GitHub
commit 59a5df8bca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 16 additions and 16 deletions

View File

@ -63,6 +63,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.731.1" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.807.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2019.809.0" />
</ItemGroup>
</Project>

View File

@ -100,7 +100,7 @@ public bool Hitting
}
}
private Cached subtractionCache = new Cached();
private readonly Cached subtractionCache = new Cached();
public override bool Invalidate(Invalidation invalidation = Invalidation.All, Drawable source = null, bool shallPropagate = true)
{

View File

@ -26,7 +26,7 @@ public class Slider : OsuHitObject, IHasCurve
public double EndTime => StartTime + this.SpanCount() * Path.Distance / Velocity;
public double Duration => EndTime - StartTime;
private Cached<Vector2> endPositionCache;
private readonly Cached<Vector2> endPositionCache = new Cached<Vector2>();
public override Vector2 EndPosition => endPositionCache.IsValid ? endPositionCache.Value : endPositionCache.Value = Position + this.CurvePositionAt(1);

View File

@ -88,7 +88,7 @@ void addMatch(TournamentMatch match) =>
};
}
private Cached layout = new Cached();
private readonly Cached layout = new Cached();
protected override void Update()
{

View File

@ -191,7 +191,7 @@ private class TrianglesDrawNode : DrawNode
private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
private Vector2 size;
private TriangleBatch<TexturedVertex2D> vertexBatch;
private QuadBatch<TexturedVertex2D> vertexBatch;
public TrianglesDrawNode(Triangles source)
: base(source)
@ -217,7 +217,7 @@ public override void Draw(Action<TexturedVertex2D> vertexAction)
if (Source.AimCount > 0 && (vertexBatch == null || vertexBatch.Size != Source.AimCount))
{
vertexBatch?.Dispose();
vertexBatch = new TriangleBatch<TexturedVertex2D>(Source.AimCount, 1);
vertexBatch = new QuadBatch<TexturedVertex2D>(Source.AimCount, 1);
}
shader.Bind();

View File

@ -93,7 +93,7 @@ public override bool Invalidate(Invalidation invalidation = Invalidation.All, Dr
return base.Invalidate(invalidation, source, shallPropagate);
}
private Cached pathCached = new Cached();
private readonly Cached pathCached = new Cached();
protected override void Update()
{

View File

@ -19,7 +19,7 @@ public class ScrollingHitObjectContainer : HitObjectContainer
[Resolved]
private IScrollingInfo scrollingInfo { get; set; }
private Cached initialStateCache = new Cached();
private readonly Cached initialStateCache = new Cached();
public ScrollingHitObjectContainer()
{

View File

@ -75,7 +75,7 @@ public override bool Invalidate(Invalidation invalidation = Invalidation.All, Dr
return base.Invalidate(invalidation, source, shallPropagate);
}
private Cached layout = new Cached();
private readonly Cached layout = new Cached();
private ScheduledDelegate scheduledCreate;
protected override void Update()

View File

@ -93,8 +93,8 @@ private void loadBeatmapSets(IEnumerable<BeatmapSetInfo> beatmapSets)
}
private readonly List<float> yPositions = new List<float>();
private Cached itemsCache = new Cached();
private Cached scrollPositionCache = new Cached();
private readonly Cached itemsCache = new Cached();
private readonly Cached scrollPositionCache = new Cached();
private readonly Container<DrawableCarouselItem> scrollableContent;

View File

@ -15,10 +15,10 @@ public class CommandTimeline<T> : ICommandTimeline
public IEnumerable<TypedCommand> Commands => commands.OrderBy(c => c.StartTime);
public bool HasCommands => commands.Count > 0;
private Cached<double> startTimeBacking;
private readonly Cached<double> startTimeBacking = new Cached<double>();
public double StartTime => startTimeBacking.IsValid ? startTimeBacking : startTimeBacking.Value = HasCommands ? commands.Min(c => c.StartTime) : double.MinValue;
private Cached<double> endTimeBacking;
private readonly Cached<double> endTimeBacking = new Cached<double>();
public double EndTime => endTimeBacking.IsValid ? endTimeBacking : endTimeBacking.Value = HasCommands ? commands.Max(c => c.EndTime) : double.MaxValue;
public T StartValue => HasCommands ? commands.OrderBy(c => c.StartTime).First().StartValue : default;

View File

@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.731.1" />
<PackageReference Include="ppy.osu.Framework" Version="2019.807.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.809.0" />
<PackageReference Include="SharpCompress" Version="0.23.0" />
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />

View File

@ -105,8 +105,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.731.1" />
<PackageReference Include="ppy.osu.Framework" Version="2019.807.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.807.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.809.0" />
<PackageReference Include="ppy.osu.Framework.iOS" Version="2019.809.0" />
<PackageReference Include="SharpCompress" Version="0.22.0" />
<PackageReference Include="NUnit" Version="3.11.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" />