Serialize playlists

This commit is contained in:
Flamefire committed 2014-10-27 18:40:47 +01:00
1 parent 206a6cda35
commit 1698c1b027
10 files changed
+76 -96

No files matched your search

+8
View File
@@ -46,6 +46,14 @@ namespace VocaluxeLib.Menu
{
GameMode = EGameMode.TR_GAMEMODE_NORMAL;
}
public SPlaylistSong ToStruct()
{
CSong song = CBase.Songs.GetSongByID(SongID);
if (song == null)
throw new Exception("Can't find Song. This should never happen!");
return new SPlaylistSong{Artist = song.Artist, Title = song.Title, GameMode = GameMode};
}
}
[XmlType("Playlist")]
+1
View File
@@ -108,6 +108,7 @@
<Compile Include="Draw\CTextureRef.cs" />
<Compile Include="Menu\IThemeable.cs" />
<Compile Include="Menu\SingNotes\CNoteBars.cs" />
<Compile Include="XmlStructs.cs" />
<Compile Include="Xml\CTypeExtensions.cs" />
<Compile Include="Xml\CXmlDeserializer.cs" />
<Compile Include="Xml\CXMLReader.cs" />
+12
View File
@@ -0,0 +1,12 @@
using System.ComponentModel;
using System.Xml.Serialization;
namespace VocaluxeLib
{
[XmlType("Song")]
public struct SPlaylistSong
{
public string Artist, Title;
[DefaultValue(EGameMode.TR_GAMEMODE_NORMAL)] public EGameMode GameMode;
}
}