Fixes string interpolation

This commit is contained in:
Kamron Batman 2018-09-14 13:07:43 -07:00
parent 42d0b6271f
commit 7d3a0ca265
233 changed files with 758 additions and 690 deletions

View file

@ -991,12 +991,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
return $"<CENTER>{text}</CENTER>";
}
public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
@ -1137,7 +1137,7 @@ namespace Server.Engines.ConPVP
break;
}
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1}", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor );
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
@ -1266,7 +1266,7 @@ namespace Server.Engines.ConPVP
return res;
}
public string Name => String.Format( "{0} Team", m_Name );
public string Name => $"{m_Name} Team";
public BRGame Game { get => m_Game;
set => m_Game = value;
@ -1399,7 +1399,7 @@ namespace Server.Engines.ConPVP
public override string ToString()
{
if ( m_Name != null )
return String.Format( "({0}) ...", Name );
return $"({Name}) ...";
else
return "...";
}
@ -1848,7 +1848,7 @@ namespace Server.Engines.ConPVP
if ( pl == leader )
item.ItemID = 4810;
item.Name = String.Format( "{0}, {1} team", item.Name, ((BRTeamInfo)teams[i]).Name.ToLower() );
item.Name = $"{item.Name}, {((BRTeamInfo) teams[i]).Name.ToLower()} team";
if ( !mob.PlaceInBackpack( item ) )
mob.BankBox.DropItem( item );

View file

@ -55,12 +55,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
return $"<CENTER>{text}</CENTER>";
}
public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
@ -199,7 +199,7 @@ namespace Server.Engines.ConPVP
break;
}
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1} Team", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name} Team", nameColor, borderColor );
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
@ -451,7 +451,8 @@ namespace Server.Engines.ConPVP
}
else if ( passTeam == useTeam && passTo.PlaceInBackpack( this ) )
{
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false, String.Format( "{0} has passed you the cookies!", from.Name ) );
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false,
$"{@from.Name} has passed you the cookies!");
}
else
{
@ -605,7 +606,7 @@ namespace Server.Engines.ConPVP
private Dictionary<Mobile, CTFPlayerInfo> m_Players;
string IRankedCTF.Name => String.Format( "{0} Team", m_Name );
string IRankedCTF.Name => $"{m_Name} Team";
public CTFGame Game { get => m_Game;
set => m_Game = value;
@ -1231,7 +1232,7 @@ namespace Server.Engines.ConPVP
if ( pl == leader )
item.ItemID = 4810;
item.Name = String.Format( "{0}, {1} team", item.Name, teams[i].Name.ToLower() );
item.Name = $"{item.Name}, {teams[i].Name.ToLower()} team";
if ( !mob.PlaceInBackpack( item ) )
mob.BankBox.DropItem( item );

View file

@ -53,12 +53,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
return $"<CENTER>{text}</CENTER>";
}
public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
@ -195,7 +195,7 @@ namespace Server.Engines.ConPVP
break;
}
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1}", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor );
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
@ -297,7 +297,7 @@ namespace Server.Engines.ConPVP
private Dictionary<Mobile, DDPlayerInfo> m_Players;
public string Name => String.Format( "{0} Team", m_Name );
public string Name => $"{m_Name} Team";
public DDGame Game { get => m_Game;
set => m_Game = value;
@ -840,7 +840,7 @@ namespace Server.Engines.ConPVP
if ( pl == leader )
item.ItemID = 4810;
item.Name = String.Format( "{0}, {1} team", item.Name, ((DDTeamInfo)teams[i]).Name.ToLower() );
item.Name = $"{item.Name}, {((DDTeamInfo) teams[i]).Name.ToLower()} team";
if ( !mob.PlaceInBackpack( item ) )
mob.BankBox.DropItem( item );

View file

@ -195,7 +195,7 @@ namespace Server.Engines.ConPVP
m_KingTimer.StartHillTicker();
if (m_King.Name != null)
PublicOverheadMessage(MessageType.Regular, 0x0481, false, String.Format("Taken by {0}!", m_King.Name));
PublicOverheadMessage(MessageType.Regular, 0x0481, false, $"Taken by {m_King.Name}!");
}
private class KingTimer : Timer
@ -365,12 +365,12 @@ namespace Server.Engines.ConPVP
{
public string Center(string text)
{
return String.Format("<CENTER>{0}</CENTER>", text);
return $"<CENTER>{text}</CENTER>";
}
public string Color(string text, int color)
{
return String.Format("<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text);
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
@ -490,7 +490,7 @@ namespace Server.Engines.ConPVP
break;
}
AddBorderedText(60, 65 + (i * 75), 250, 20, String.Format("{0}: {1}", LadderGump.Rank(1 + i), teamInfo.Name), nameColor, borderColor);
AddBorderedText(60, 65 + (i * 75), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor);
AddBorderedText(50 + 10, 85 + (i * 75), 100, 20, "Score:", 0xFFC000, BlackColor32);
AddBorderedText(50 + 15, 105 + (i * 75), 100, 20, teamInfo.Score.ToString("N0"), 0xFFC000, BlackColor32);
@ -627,7 +627,7 @@ namespace Server.Engines.ConPVP
{
if (m_Name == null)
return "(null) Team";
return String.Format("{0} Team", m_Name);
return $"{m_Name} Team";
}
}
@ -730,7 +730,7 @@ namespace Server.Engines.ConPVP
public override string ToString()
{
if (m_Name != null)
return String.Format("({0}) ...", Name);
return $"({Name}) ...";
else
return "...";
}
@ -1216,7 +1216,7 @@ namespace Server.Engines.ConPVP
if (pl == leader)
item.ItemID = 4810;
item.Name = String.Format("{0}, {1}", item.Name, ((KHTeamInfo)teams[i]).Name.ToLower());
item.Name = $"{item.Name}, {((KHTeamInfo) teams[i]).Name.ToLower()}";
if (!mob.PlaceInBackpack(item))
mob.BankBox.DropItem(item);