2023-10-01 18:40:41 +02:00
|
|
|
|
using System.Linq;
|
|
|
|
|
using TaikoSoundEditor.Data;
|
2023-07-17 10:20:00 +02:00
|
|
|
|
|
2023-10-01 18:40:41 +02:00
|
|
|
|
namespace TaikoSoundEditor.Collections
|
2023-07-17 10:20:00 +02:00
|
|
|
|
{
|
2023-10-01 18:40:41 +02:00
|
|
|
|
public class MusicAttributes : Collection<IMusicAttribute>
|
2023-07-17 10:20:00 +02:00
|
|
|
|
{
|
2023-10-01 18:40:41 +02:00
|
|
|
|
public IMusicAttribute GetByUniqueId(int id)
|
2023-07-17 10:20:00 +02:00
|
|
|
|
{
|
|
|
|
|
return Items.Find(x => x.UniqueId == id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int GetNewId()
|
|
|
|
|
{
|
|
|
|
|
return Items.Max(i => i.UniqueId) + 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsValidSongId(string id)
|
|
|
|
|
{
|
|
|
|
|
return !Items.Any(i => i.Id == id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|