Simplefied PCKAudioFile.Categories and removed null check when looping over PCKAudioFile.Categories

This commit is contained in:
miku-666
2022-08-06 06:23:41 +02:00
parent 2c2fd9d691
commit 6466dfcf8e
5 changed files with 10 additions and 38 deletions

View File

@@ -57,10 +57,9 @@ namespace PckStudio.Classes.IO.PCK
private void WriteCategories(Stream stream)
{
WriteInt(stream, _file.GetCategoryCount());
WriteInt(stream, _file.Categories.Length);
foreach (var category in _file.Categories)
{
if (category is null) continue;
WriteInt(stream, (int)category.parameterType);
WriteInt(stream, (int)category.audioType);
WriteString(stream, category.Name);
@@ -72,7 +71,6 @@ namespace PckStudio.Classes.IO.PCK
bool addCredit = true;
foreach (var category in _file.Categories)
{
if (category is null) continue;
WriteInt(stream, category.SongNames.Count + (addCredit ? _file.Credits.Count * 2 : 0));
foreach (var name in category.SongNames)
{