From 4f8c4826459ed0356479bafa554ef141b6a15032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20K=C3=BCpper?= Date: Mon, 15 Sep 2014 19:44:19 +0200 Subject: [PATCH] Remove unneeded constructors. --- VocaluxeLib/Menu/CBackground.cs | 14 +------ VocaluxeLib/Menu/CButton.cs | 19 +-------- VocaluxeLib/Menu/CEqualizer.cs | 18 +------- VocaluxeLib/Menu/CLyric.cs | 12 +----- VocaluxeLib/Menu/CNameSelection.cs | 34 +-------------- VocaluxeLib/Menu/CParticle.cs | 15 +------ VocaluxeLib/Menu/CScreenSetting.cs | 11 +---- VocaluxeLib/Menu/CSelectSlide.cs | 33 +-------------- VocaluxeLib/Menu/CStatic.cs | 13 +----- VocaluxeLib/Menu/CText.cs | 22 +--------- .../Menu/SongMenu/CSongMenuFramework.cs | 41 +++++-------------- .../Menu/SongMenu/CSongMenuTileBoard.cs | 36 ++++++++-------- 12 files changed, 48 insertions(+), 220 deletions(-) diff --git a/VocaluxeLib/Menu/CBackground.cs b/VocaluxeLib/Menu/CBackground.cs index 08659da7..8a752512 100644 --- a/VocaluxeLib/Menu/CBackground.cs +++ b/VocaluxeLib/Menu/CBackground.cs @@ -48,16 +48,6 @@ namespace VocaluxeLib.Menu [XmlElement("Skin")] public string TextureName; public SThemeColor Color; - - public SThemeBackground(SThemeBackground theme) - { - Name = theme.Name; - Type = theme.Type; - SlideShowTextures = theme.SlideShowTextures; - VideoName = theme.VideoName; - TextureName = theme.TextureName; - Color = new SThemeColor(theme.Color); - } } public class CBackground : IMenuElement @@ -93,7 +83,7 @@ namespace VocaluxeLib.Menu public CBackground(SThemeBackground theme, int partyModeID) { - _Theme = new SThemeBackground(theme); + _Theme = theme; _PartyModeID = partyModeID; LoadTextures(); @@ -274,7 +264,7 @@ namespace VocaluxeLib.Menu public SThemeBackground GetTheme() { - return new SThemeBackground(_Theme); + return _Theme; } #endregion public diff --git a/VocaluxeLib/Menu/CButton.cs b/VocaluxeLib/Menu/CButton.cs index 8d88f7f7..44383244 100644 --- a/VocaluxeLib/Menu/CButton.cs +++ b/VocaluxeLib/Menu/CButton.cs @@ -46,21 +46,6 @@ namespace VocaluxeLib.Menu public SReflection Reflection; [XmlElement("SelReflection")] public SReflection SelReflection; - - public SThemeButton(SThemeButton theme) - { - Name = theme.Name; - TextureName = theme.TextureName; - SelTextureName = theme.SelTextureName; - Rect = new SRectF(theme.Rect); - Color = new SThemeColor(theme.Color); - SelColor = new SThemeColor(theme.SelColor); - Text = new SThemeText(theme.Text); - SText = new SThemeText(theme.SText); - Reflection = new SReflection(theme.Reflection); - SelReflection = new SReflection(theme.SelReflection); - STextSpecified = theme.STextSpecified; - } } public class CButton : IMenuElement @@ -144,7 +129,7 @@ namespace VocaluxeLib.Menu public CButton(SThemeButton theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeButton(theme); + _Theme = theme; Selected = false; EditMode = false; @@ -452,7 +437,7 @@ namespace VocaluxeLib.Menu public SThemeButton GetTheme() { - return new SThemeButton(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/CEqualizer.cs b/VocaluxeLib/Menu/CEqualizer.cs index 1f533e7e..8e8e934a 100644 --- a/VocaluxeLib/Menu/CEqualizer.cs +++ b/VocaluxeLib/Menu/CEqualizer.cs @@ -53,20 +53,6 @@ namespace VocaluxeLib.Menu public SThemeColor MaxColor; [XmlElement("Reflection")] public SReflection Reflection; - - public SThemeEqualizer(SThemeEqualizer theme) - { - Name = theme.Name; - TextureName = theme.TextureName; - Rect = new SRectF(theme.Rect); - NumBars = theme.NumBars; - Space = theme.Space; - Style = theme.Style; - DrawNegative = theme.DrawNegative; - Color = new SThemeColor(theme.Color); - MaxColor = new SThemeColor(theme.MaxColor); - Reflection = new SReflection(theme.Reflection); - } } public class CEqualizer : IMenuElement @@ -124,7 +110,7 @@ namespace VocaluxeLib.Menu public CEqualizer(SThemeEqualizer theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeEqualizer(theme); + _Theme = theme; Visible = true; ScreenHandles = false; @@ -370,7 +356,7 @@ namespace VocaluxeLib.Menu public SThemeEqualizer GetTheme() { - return new SThemeEqualizer(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/CLyric.cs b/VocaluxeLib/Menu/CLyric.cs index c7e20105..8719cb87 100644 --- a/VocaluxeLib/Menu/CLyric.cs +++ b/VocaluxeLib/Menu/CLyric.cs @@ -35,14 +35,6 @@ namespace VocaluxeLib.Menu public SThemeColor Color; [XmlElement("SColor")] public SThemeColor SColor; - - public SThemeLyrics(SThemeLyrics theme) - { - Name = theme.Name; - Rect = new SRectF(theme.Rect); - Color = new SThemeColor(theme.Color); - SColor = new SThemeColor(theme.SColor); - } } public class CLyric : IMenuElement @@ -131,7 +123,7 @@ namespace VocaluxeLib.Menu public CLyric(SThemeLyrics theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeLyrics(theme); + _Theme = theme; _Line = new CSongLine(); _Text = new CText(_PartyModeID); @@ -526,7 +518,7 @@ namespace VocaluxeLib.Menu public SThemeLyrics GetTheme() { - return new SThemeLyrics(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/CNameSelection.cs b/VocaluxeLib/Menu/CNameSelection.cs index 1e061cf4..f396fc60 100644 --- a/VocaluxeLib/Menu/CNameSelection.cs +++ b/VocaluxeLib/Menu/CNameSelection.cs @@ -40,16 +40,6 @@ namespace VocaluxeLib.Menu public string TextureTileSelectedName; [XmlElement("Tiles")] public SThemeNameSelectionTiles Tiles; - - public SThemeNameSelection(SThemeNameSelection theme) - { - Name = theme.Name; - Rect = new SRectF(theme.Rect); - TextureEmptyTileName = theme.TextureEmptyTileName; - ColorEmptyTile = new SThemeColor(theme.ColorEmptyTile); - TextureTileSelectedName = theme.TextureTileSelectedName; - Tiles = new SThemeNameSelectionTiles(theme.Tiles); - } } public struct SThemeNameSelectionTiles @@ -68,17 +58,6 @@ namespace VocaluxeLib.Menu public float SpaceH; [XmlElement("Name")] public SThemeNameSelectionName Name; - - public SThemeNameSelectionTiles(SThemeNameSelectionTiles theme) - { - W = theme.W; - H = theme.H; - NumW = theme.NumW; - NumH = theme.NumH; - SpaceW = theme.SpaceW; - SpaceH = theme.SpaceH; - Name = new SThemeNameSelectionName(theme.Name); - } } public struct SThemeNameSelectionName @@ -93,15 +72,6 @@ namespace VocaluxeLib.Menu public EStyle Style; [XmlElement("Color")] public SThemeColor Color; - - public SThemeNameSelectionName(SThemeNameSelectionName theme) - { - Space = theme.Space; - Height = theme.Height; - Font = theme.Font; - Style = theme.Style; - Color = new SThemeColor(theme.Color); - } } public class CNameSelection : IMenuElement @@ -176,7 +146,7 @@ namespace VocaluxeLib.Menu public CNameSelection(SThemeNameSelection theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeNameSelection(theme); + _Theme = theme; _Tiles = new List(); _VisibleProfiles = new List(); @@ -647,7 +617,7 @@ namespace VocaluxeLib.Menu public SThemeNameSelection GetTheme() { - return new SThemeNameSelection(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/CParticle.cs b/VocaluxeLib/Menu/CParticle.cs index 7dc321de..1f9b2bd9 100644 --- a/VocaluxeLib/Menu/CParticle.cs +++ b/VocaluxeLib/Menu/CParticle.cs @@ -42,17 +42,6 @@ namespace VocaluxeLib.Menu public float Size; [XmlElement("MaxNumber")] public int MaxNumber; - - public SThemeParticleEffect(SThemeParticleEffect theme) - { - Name = theme.Name; - TextureName = theme.TextureName; - Rect = new SRectF(theme.Rect); - Color = new SThemeColor(theme.Color); - Type = theme.Type; - Size = theme.Size; - MaxNumber = theme.MaxNumber; - } } public enum EParticleType @@ -401,7 +390,7 @@ namespace VocaluxeLib.Menu public CParticleEffect(SThemeParticleEffect theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeParticleEffect(theme); + _Theme = theme; _Stars = new List(); _SpawnTimer = new Stopwatch(); _NextSpawnTime = 0f; @@ -656,7 +645,7 @@ namespace VocaluxeLib.Menu public SThemeParticleEffect GetTheme() { - return new SThemeParticleEffect(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/CScreenSetting.cs b/VocaluxeLib/Menu/CScreenSetting.cs index 2f4e1bf5..ea6c7bd9 100644 --- a/VocaluxeLib/Menu/CScreenSetting.cs +++ b/VocaluxeLib/Menu/CScreenSetting.cs @@ -39,13 +39,6 @@ namespace VocaluxeLib.Menu public string Value; [XmlElement("Type")] public ESettingType Type; - - public SScreenSetting(SScreenSetting theme) - { - Name = theme.Name; - Value = theme.Value; - Type = theme.Type; - } } // ReSharper disable ClassNeverInstantiated.Global @@ -78,7 +71,7 @@ namespace VocaluxeLib.Menu public CScreenSetting(SScreenSetting theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SScreenSetting(theme); + _Theme = theme; } public bool LoadTheme(string xmlPath, string elementName, CXMLReader xmlReader, int skinIndex) @@ -138,7 +131,7 @@ namespace VocaluxeLib.Menu public SScreenSetting GetTheme() { - return new SScreenSetting(_Theme); + return _Theme; } #region Private diff --git a/VocaluxeLib/Menu/CSelectSlide.cs b/VocaluxeLib/Menu/CSelectSlide.cs index 9cd95b96..f44fa0d8 100644 --- a/VocaluxeLib/Menu/CSelectSlide.cs +++ b/VocaluxeLib/Menu/CSelectSlide.cs @@ -87,35 +87,6 @@ namespace VocaluxeLib.Menu [XmlElement("NumVisible")] public int NumVisible; - - public SThemeSelectSlide(SThemeSelectSlide theme) - { - Name = theme.Name; - TextureName = theme.TextureName; - TextureArrowLeftName = theme.TextureArrowLeftName; - TextureArrowRightName = theme.TextureArrowRightName; - SelTextureName = theme.SelTextureName; - SelTextureArrowLeftName = theme.SelTextureArrowLeftName; - SelTextureArrowRightName = theme.SelTextureArrowRightName; - HighlightTextureName = theme.HighlightTextureName; - Rect = new SRectF(theme.Rect); - RectArrowLeft = new SRectF(theme.RectArrowLeft); - RectArrowRight = new SRectF(theme.RectArrowRight); - Color = new SThemeColor(theme.Color); - SColor = new SThemeColor(theme.SColor); - HColor = new SThemeColor(theme.HColor); - ArrowColor = new SThemeColor(theme.ArrowColor); - ArrowSColor = new SThemeColor(theme.ArrowSColor); - TextColor = new SThemeColor(theme.TextColor); - TextSColor = new SThemeColor(theme.TextSColor); - TextH = theme.TextH; - TextRelativeX = theme.TextRelativeX; - TextRelativeY = theme.TextRelativeY; - TextMaxW = theme.TextMaxW; - TextFont = theme.TextFont; - TextStyle = theme.TextStyle; - NumVisible = theme.NumVisible; - } } public class CSelectSlide : IMenuElement, ICloneable @@ -314,7 +285,7 @@ namespace VocaluxeLib.Menu public CSelectSlide(SThemeSelectSlide theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeSelectSlide(theme); + _Theme = theme; _Selected = false; _Textures = new List(); @@ -913,7 +884,7 @@ namespace VocaluxeLib.Menu public SThemeSelectSlide GetTheme() { - return new SThemeSelectSlide(_Theme); + return _Theme; } public void UnloadTextures() {} diff --git a/VocaluxeLib/Menu/CStatic.cs b/VocaluxeLib/Menu/CStatic.cs index a7f89336..046f9ebe 100644 --- a/VocaluxeLib/Menu/CStatic.cs +++ b/VocaluxeLib/Menu/CStatic.cs @@ -32,15 +32,6 @@ namespace VocaluxeLib.Menu public SThemeColor Color; public SRectF Rect; public SReflection Reflection; - - public SThemeStatic(SThemeStatic theme) - { - Name = theme.Name; - TextureName = theme.TextureName; - Color = new SThemeColor(theme.Color); - Rect = new SRectF(theme.Rect); - Reflection = new SReflection(theme.Reflection); - } } public class CStatic : IMenuElement @@ -128,7 +119,7 @@ namespace VocaluxeLib.Menu public CStatic(SThemeStatic theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeStatic(theme); + _Theme = theme; LoadTextures(); } @@ -281,7 +272,7 @@ namespace VocaluxeLib.Menu public SThemeStatic GetTheme() { - return new SThemeStatic(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/CText.cs b/VocaluxeLib/Menu/CText.cs index 06777092..35c07bf7 100644 --- a/VocaluxeLib/Menu/CText.cs +++ b/VocaluxeLib/Menu/CText.cs @@ -51,24 +51,6 @@ namespace VocaluxeLib.Menu [XmlElement("Text")] public string Text; public SReflection Reflection; - - public SThemeText(SThemeText theme) - { - Name = theme.Name; - X = theme.X; - Y = theme.Y; - Z = theme.Z; - Height = theme.Height; - MaxWidth = theme.MaxWidth; - Color = new SThemeColor(theme.Color); - SColor = new SThemeColor(theme.SColor); - Align = theme.Align; - ResizeAlign = theme.ResizeAlign; - Style = theme.Style; - Font = theme.Font; - Text = theme.Text; - Reflection = new SReflection(theme.Reflection); - } } public class CText : IMenuElement @@ -356,7 +338,7 @@ namespace VocaluxeLib.Menu public CText(SThemeText theme, int partyModeID) { _PartyModeID = partyModeID; - _Theme = new SThemeText(theme); + _Theme = theme; LoadTextures(); } @@ -628,7 +610,7 @@ namespace VocaluxeLib.Menu public SThemeText GetTheme() { - return new SThemeText(_Theme); + return _Theme; } #region ThemeEdit diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs index d30ff70b..e6d57109 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuFramework.cs @@ -63,7 +63,7 @@ namespace VocaluxeLib.Menu.SongMenu MedleyCalcIcon = theme.MedleyCalcIcon; MedleyTagIcon = theme.MedleyTagIcon; Color = new SThemeColor(theme.Color); - SongMenuTileBoard = new SThemeSongMenuTileBoard(theme.SongMenuTileBoard); + SongMenuTileBoard = theme.SongMenuTileBoard; } } @@ -111,45 +111,24 @@ namespace VocaluxeLib.Menu.SongMenu public SRectF TileRectSmall; [XmlElement("TextArtist")] - public SThemeText STextArtist; + public SThemeText TextArtist; [XmlElement("TextTitle")] - public SThemeText STextTitle; + public SThemeText TextTitle; [XmlElement("TextSongLength")] - public SThemeText STextSongLength; + public SThemeText TextSongLength; [XmlElement("StaticCoverBig")] - public SThemeStatic SStaticCoverBig; + public SThemeStatic StaticCoverBig; [XmlElement("StaticTextBG")] - public SThemeStatic SStaticTextBG; + public SThemeStatic StaticTextBG; [XmlElement("StaticDuetIcon")] - public SThemeStatic SStaticDuetIcon; + public SThemeStatic StaticDuetIcon; [XmlElement("StaticVideoIcon")] - public SThemeStatic SStaticVideoIcon; + public SThemeStatic StaticVideoIcon; [XmlElement("StaticMedleyCalcIcon")] - public SThemeStatic SStaticMedleyCalcIcon; + public SThemeStatic StaticMedleyCalcIcon; [XmlElement("StaticMedleyTagIcon")] - public SThemeStatic SStaticMedleyTagIcon; - - public SThemeSongMenuTileBoard(SThemeSongMenuTileBoard theme) - { - NumW = theme.NumW; - NumH = theme.NumH; - NumWsmall = theme.NumWsmall; - NumHsmall = theme.NumHsmall; - SpaceW = theme.SpaceW; - SpaceH = theme.SpaceH; - TileRect = new SRectF(theme.TileRect); - TileRectSmall = new SRectF(theme.TileRectSmall); - STextArtist = new SThemeText(theme.STextArtist); - STextTitle = new SThemeText(theme.STextTitle); - STextSongLength = new SThemeText(theme.STextSongLength); - SStaticCoverBig = new SThemeStatic(theme.SStaticCoverBig); - SStaticTextBG = new SThemeStatic(theme.SStaticTextBG); - SStaticDuetIcon = new SThemeStatic(theme.SStaticDuetIcon); - SStaticVideoIcon = new SThemeStatic(theme.SStaticVideoIcon); - SStaticMedleyCalcIcon = new SThemeStatic(theme.SStaticMedleyCalcIcon); - SStaticMedleyTagIcon = new SThemeStatic(theme.SStaticMedleyTagIcon); - } + public SThemeStatic StaticMedleyTagIcon; } abstract class CSongMenuFramework : ISongMenu diff --git a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs index 71d57dc9..3818d35d 100644 --- a/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs +++ b/VocaluxeLib/Menu/SongMenu/CSongMenuTileBoard.cs @@ -141,15 +141,15 @@ namespace VocaluxeLib.Menu.SongMenu { _Theme.Name = elementName; - _Theme.SongMenuTileBoard.STextArtist = _Artist.GetTheme(); - _Theme.SongMenuTileBoard.STextSongLength = _SongLength.GetTheme(); - _Theme.SongMenuTileBoard.STextTitle = _Title.GetTheme(); - _Theme.SongMenuTileBoard.SStaticCoverBig = _CoverBig.GetTheme(); - _Theme.SongMenuTileBoard.SStaticDuetIcon = _DuetIcon.GetTheme(); - _Theme.SongMenuTileBoard.SStaticMedleyCalcIcon = _MedleyCalcIcon.GetTheme(); - _Theme.SongMenuTileBoard.SStaticMedleyTagIcon = _MedleyTagIcon.GetTheme(); - _Theme.SongMenuTileBoard.SStaticTextBG = _TextBG.GetTheme(); - _Theme.SongMenuTileBoard.SStaticVideoIcon = _VideoIcon.GetTheme(); + _Theme.SongMenuTileBoard.TextArtist = _Artist.GetTheme(); + _Theme.SongMenuTileBoard.TextSongLength = _SongLength.GetTheme(); + _Theme.SongMenuTileBoard.TextTitle = _Title.GetTheme(); + _Theme.SongMenuTileBoard.StaticCoverBig = _CoverBig.GetTheme(); + _Theme.SongMenuTileBoard.StaticDuetIcon = _DuetIcon.GetTheme(); + _Theme.SongMenuTileBoard.StaticMedleyCalcIcon = _MedleyCalcIcon.GetTheme(); + _Theme.SongMenuTileBoard.StaticMedleyTagIcon = _MedleyTagIcon.GetTheme(); + _Theme.SongMenuTileBoard.StaticTextBG = _TextBG.GetTheme(); + _Theme.SongMenuTileBoard.StaticVideoIcon = _VideoIcon.GetTheme(); LoadTextures(); Init(); @@ -670,15 +670,15 @@ namespace VocaluxeLib.Menu.SongMenu { base.LoadTextures(); - _Artist = new CText(_Theme.SongMenuTileBoard.STextArtist, _PartyModeID); - _Title = new CText(_Theme.SongMenuTileBoard.STextTitle, _PartyModeID); - _SongLength = new CText(_Theme.SongMenuTileBoard.STextSongLength, _PartyModeID); - _CoverBig = new CStatic(_Theme.SongMenuTileBoard.SStaticCoverBig, _PartyModeID); - _TextBG = new CStatic(_Theme.SongMenuTileBoard.SStaticTextBG, _PartyModeID); - _DuetIcon = new CStatic(_Theme.SongMenuTileBoard.SStaticDuetIcon, _PartyModeID); - _VideoIcon = new CStatic(_Theme.SongMenuTileBoard.SStaticVideoIcon, _PartyModeID); - _MedleyCalcIcon = new CStatic(_Theme.SongMenuTileBoard.SStaticMedleyCalcIcon, _PartyModeID); - _MedleyTagIcon = new CStatic(_Theme.SongMenuTileBoard.SStaticMedleyTagIcon, _PartyModeID); + _Artist = new CText(_Theme.SongMenuTileBoard.TextArtist, _PartyModeID); + _Title = new CText(_Theme.SongMenuTileBoard.TextTitle, _PartyModeID); + _SongLength = new CText(_Theme.SongMenuTileBoard.TextSongLength, _PartyModeID); + _CoverBig = new CStatic(_Theme.SongMenuTileBoard.StaticCoverBig, _PartyModeID); + _TextBG = new CStatic(_Theme.SongMenuTileBoard.StaticTextBG, _PartyModeID); + _DuetIcon = new CStatic(_Theme.SongMenuTileBoard.StaticDuetIcon, _PartyModeID); + _VideoIcon = new CStatic(_Theme.SongMenuTileBoard.StaticVideoIcon, _PartyModeID); + _MedleyCalcIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyCalcIcon, _PartyModeID); + _MedleyTagIcon = new CStatic(_Theme.SongMenuTileBoard.StaticMedleyTagIcon, _PartyModeID); Init(); }