mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add initial hit sample pooling
This commit is contained in:
@ -1,14 +1,16 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Audio
|
||||
{
|
||||
/// <summary>
|
||||
/// Describes a gameplay sample.
|
||||
/// </summary>
|
||||
public class SampleInfo : ISampleInfo
|
||||
public class SampleInfo : ISampleInfo, IEquatable<SampleInfo>
|
||||
{
|
||||
private readonly string[] sampleNames;
|
||||
|
||||
@ -20,5 +22,16 @@ namespace osu.Game.Audio
|
||||
public IEnumerable<string> LookupNames => sampleNames;
|
||||
|
||||
public int Volume { get; } = 100;
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(sampleNames, Volume);
|
||||
}
|
||||
|
||||
public bool Equals(SampleInfo other)
|
||||
=> other != null && sampleNames.SequenceEqual(other.sampleNames);
|
||||
|
||||
public override bool Equals(object obj)
|
||||
=> obj is SampleInfo other && Equals(other);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user