From 7d3a0ca265059b7fd974adac58339c383757174b Mon Sep 17 00:00:00 2001
From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com>
Date: Fri, 14 Sep 2018 13:07:43 -0700
Subject: [PATCH] Fixes string interpolation
---
Scripts/Accounting/AccountHandler.cs | 5 +-
Scripts/Accounting/Firewall.cs | 2 +-
Scripts/Commands/Decorate.cs | 4 +-
Scripts/Commands/DecorateMag.cs | 4 +-
Scripts/Commands/Docs.cs | 8 +-
Scripts/Commands/GenCategorization.cs | 6 +-
.../Commands/Generic/Commands/BaseCommand.cs | 2 +-
Scripts/Commands/Generic/Commands/Commands.cs | 16 +-
.../Commands/Generic/Commands/DesignInsert.cs | 3 +-
.../Commands/Generic/Commands/Interface.cs | 11 +-
.../Compilers/ConditionalCompiler.cs | 6 +-
.../Generic/Implementors/ObjectConditional.cs | 4 +-
Scripts/Commands/Handlers.cs | 11 +-
Scripts/Commands/HelpInfo.cs | 11 +-
Scripts/Commands/Logging.cs | 10 +-
Scripts/Commands/Properties.cs | 31 ++-
Scripts/Commands/Skills.cs | 2 +-
Scripts/Commands/Statics.cs | 6 +-
Scripts/Engines/BulkOrders/Books/BOBGump.cs | 4 +-
Scripts/Engines/BulkOrders/SmallBulkEntry.cs | 2 +-
Scripts/Engines/ConPVP/AcceptDuelGump.cs | 4 +-
Scripts/Engines/ConPVP/ArenaGump.cs | 4 +-
Scripts/Engines/ConPVP/BeginGump.cs | 4 +-
Scripts/Engines/ConPVP/DuelContext.cs | 23 ++-
Scripts/Engines/ConPVP/DuelContextGump.cs | 2 +-
Scripts/Engines/ConPVP/Games/BombingRun.cs | 12 +-
Scripts/Engines/ConPVP/Games/CTF.cs | 13 +-
Scripts/Engines/ConPVP/Games/DoubleDom.cs | 10 +-
Scripts/Engines/ConPVP/Games/KingOfTheHill.cs | 14 +-
Scripts/Engines/ConPVP/LadderGump.cs | 4 +-
Scripts/Engines/ConPVP/ParticipantGump.cs | 6 +-
Scripts/Engines/ConPVP/PickRulesetGump.cs | 2 +-
Scripts/Engines/ConPVP/Preferences.cs | 4 +-
Scripts/Engines/ConPVP/ReadyGump.cs | 4 +-
Scripts/Engines/ConPVP/ReadyUpGump.cs | 8 +-
Scripts/Engines/ConPVP/RulesetGump.cs | 2 +-
Scripts/Engines/ConPVP/Tournament.cs | 194 ++++++++++--------
Scripts/Engines/ConPVP/Trophy.cs | 2 +-
Scripts/Engines/Craft/Core/CraftGump.cs | 8 +-
Scripts/Engines/Craft/Core/CraftGumpItem.cs | 8 +-
Scripts/Engines/Craft/Core/CraftItem.cs | 3 +-
Scripts/Engines/Factions/Core/Faction.cs | 4 +-
.../Factions/Gumps/ElectionManagementGump.cs | 8 +-
.../Factions/Items/Traps/BaseFactionTrap.cs | 2 +-
.../Factions/Mobiles/Guards/GuardAI.cs | 2 +-
Scripts/Engines/Help/PageQueueGump.cs | 14 +-
Scripts/Engines/Help/PageResponseGump.cs | 2 +-
Scripts/Engines/Help/SpeechLogGump.cs | 5 +-
Scripts/Engines/Khaldun/KhaldunGen.cs | 2 +-
.../Engines/MLQuests/Gumps/BaseQuestGump.cs | 2 +-
.../Engines/MLQuests/Gumps/RaceChangeGump.cs | 2 +-
Scripts/Engines/MLQuests/Items/Teleporters.cs | 4 +-
Scripts/Engines/MLQuests/MLQuest.cs | 2 +-
.../Engines/MLQuests/Mobiles/BoonCollector.cs | 2 +-
.../MLQuests/Objectives/DeliverObjective.cs | 2 +-
.../MLQuests/Objectives/GainSkillObjective.cs | 4 +-
Scripts/Engines/MyRunUO/Config.cs | 4 +-
Scripts/Engines/MyRunUO/MyRunUO.cs | 6 +-
Scripts/Engines/MyRunUO/MyRunUOStatus.cs | 3 +-
Scripts/Engines/Party/Party.cs | 2 +-
Scripts/Engines/Plants/PlantItem.cs | 19 +-
Scripts/Engines/Plants/ReproductionGump.cs | 4 +-
Scripts/Engines/Plants/Seed.cs | 8 +-
Scripts/Engines/Quests/Core/QuestSystem.cs | 2 +-
Scripts/Engines/RemoteAdmin/Network.cs | 11 +-
Scripts/Engines/RemoteAdmin/PacketHandlers.cs | 3 +-
.../Engines/RemoteAdmin/RemoteAdminLogging.cs | 2 +-
.../Engines/Reports/Rendering/HtmlRenderer.cs | 8 +-
.../Reports/Rendering/PieChartRenderer.cs | 2 +-
Scripts/Engines/Reports/Reports.cs | 4 +-
.../Treasures of Tokuno/TreasuresOfTokuno.cs | 10 +-
.../Character Statue Maker/CharacterStatue.cs | 2 +-
.../VeteranRewards/RewardChoiceGump.cs | 2 +-
Scripts/Engines/Virtues/Justice.cs | 4 +-
Scripts/Engines/Virtues/VirtueGump.cs | 2 +-
Scripts/Gumps/AddDoorGump.cs | 5 +-
Scripts/Gumps/AdminGump.cs | 78 ++++---
Scripts/Gumps/BanDurationGump.cs | 3 +-
Scripts/Gumps/BaseGridGump.cs | 4 +-
Scripts/Gumps/CategorizedAddGump.cs | 5 +-
Scripts/Gumps/ClientGump.cs | 8 +-
Scripts/Gumps/CommentsGump.cs | 5 +-
Scripts/Gumps/Go/GoGump.cs | 2 +-
Scripts/Gumps/Guilds/GuildRosterGump.cs | 2 +-
.../Guilds/New Guild System/BaseGuildGump.cs | 2 +-
.../GuildInvitationRequest.cs | 6 +-
.../New Guild System/GuildRosterGump.cs | 2 +-
.../Guilds/New Guild System/OtherGuildInfo.cs | 32 +--
.../New Guild System/War Declaration gump.cs | 4 +-
Scripts/Gumps/HouseGump.cs | 6 +-
Scripts/Gumps/HouseGumpAOS.cs | 2 +-
Scripts/Gumps/NoticeGump.cs | 2 +-
Scripts/Gumps/PetResurrectGump.cs | 2 +-
Scripts/Gumps/PlayerVendorGumps.cs | 3 +-
Scripts/Gumps/Props/PropsGump.cs | 33 +--
Scripts/Gumps/Props/SetBodyGump.cs | 4 +-
Scripts/Gumps/RunebookGump.cs | 16 +-
Scripts/Gumps/SkillsGump.cs | 2 +-
Scripts/Gumps/VendorInventoryGump.cs | 2 +-
Scripts/Gumps/ViewHousesGump.cs | 10 +-
Scripts/Gumps/WarningGump.cs | 2 +-
Scripts/Gumps/WhoGump.cs | 3 +-
.../Halloween/2006/Engines/TrickOrTreat.cs | 2 +-
.../Halloween/2006/Items/HalloweenPumpkin.cs | 2 +-
.../Halloween/2011/Items/BasePaintedMask.cs | 2 +-
.../Halloween/2012/Engines/PlayerZombies.cs | 4 +-
.../Valentine/2011/Items/StValentinesBears.cs | 2 +-
.../Valentine/2012/Items/CupidsArrow.cs | 4 +-
Scripts/Items/Addons/ArcheryButteAddon.cs | 7 +-
Scripts/Items/Addons/BallotBox.cs | 4 +-
Scripts/Items/Addons/SolenAntHole.cs | 3 +-
Scripts/Items/Aquarium/Aquarium.cs | 20 +-
Scripts/Items/Aquarium/AquariumGump.cs | 2 +-
Scripts/Items/Armor/BaseArmor.cs | 2 +-
Scripts/Items/Armor/Leather/LeafGloves.cs | 2 +-
Scripts/Items/Armor/Leather/LeatherGloves.cs | 2 +-
Scripts/Items/Body Parts/Head.cs | 6 +-
Scripts/Items/Clothing/BaseClothing.cs | 2 +-
Scripts/Items/Clothing/Cloaks.cs | 2 +-
Scripts/Items/Clothing/OuterTorso.cs | 2 +-
Scripts/Items/Clothing/Shoes.cs | 2 +-
Scripts/Items/Containers/SalvageBag.cs | 4 +-
Scripts/Items/Deeds/CommodityDeed.cs | 10 +-
Scripts/Items/Deeds/NameChangeDeed.cs | 6 +-
Scripts/Items/Food/Beverage.cs | 2 +-
Scripts/Items/Games/Dices.cs | 3 +-
Scripts/Items/Games/Mahjong/MahjongDices.cs | 2 +-
Scripts/Items/Games/Mahjong/MahjongPlayers.cs | 2 +-
Scripts/Items/Guilds/Guildstone.cs | 8 +-
Scripts/Items/Maps/TreasureMap.cs | 7 +-
Scripts/Items/Misc/BulletinBoards.cs | 6 +-
Scripts/Items/Misc/CommunicationCrystals.cs | 2 +-
Scripts/Items/Misc/PowerGenerator.cs | 5 +-
Scripts/Items/Misc/Scales.cs | 2 +-
Scripts/Items/Misc/Teleporter.cs | 6 +-
Scripts/Items/Skill Items/Fishing/Misc/SOS.cs | 2 +-
.../Items/Skill Items/Fishing/Misc/Sextant.cs | 2 +-
.../Fishing/Misc/ShipwreckedItem.cs | 2 +-
.../BaseConflagrationPotion.cs | 2 +-
.../BaseConfusionBlastPotion.cs | 2 +-
Scripts/Items/Skill Items/Misc/RepairDeed.cs | 5 +-
Scripts/Items/Skill Items/Tinkering/Clocks.cs | 2 +-
.../Items/Skill Items/Tools/RunicSewingKit.cs | 4 +-
.../8th Anniversary Items/Talismans.cs | 2 +-
Scripts/Items/Special/HeritageToken.cs | 2 +-
Scripts/Items/Special/Holiday/HolidayBell.cs | 2 +-
Scripts/Items/Special/Holiday/SnowGlobes.cs | 2 +-
.../Special/House Raffle/HouseRaffleDeed.cs | 45 ++--
.../House Raffle/HouseRaffleManagementGump.cs | 8 +-
.../Special/House Raffle/HouseRaffleStone.cs | 9 +-
Scripts/Items/Special/SoulStone.cs | 2 +-
.../Special/Special Scrolls/PowerScroll.cs | 2 +-
.../Special Scrolls/ScrollofTranscendence.cs | 3 +-
.../Special/Special Scrolls/StatScroll.cs | 3 +-
.../Special/Valentines/2007/ValentinesCard.cs | 5 +-
Scripts/Items/Weapons/BaseWeapon.cs | 4 +-
Scripts/Misc/AutoSave.cs | 11 +-
Scripts/Misc/BuffIcons.cs | 2 +-
Scripts/Misc/ClientVerification.cs | 5 +-
Scripts/Misc/CrashGuard.cs | 13 +-
Scripts/Misc/Email.cs | 2 +-
Scripts/Misc/Emitter.cs | 4 +-
Scripts/Misc/LanguageStatistics.cs | 19 +-
Scripts/Misc/Poison.cs | 2 +-
Scripts/Misc/RenameRequests.cs | 2 +-
Scripts/Misc/ShardPoller.cs | 8 +-
Scripts/Misc/TextDefinition.cs | 4 +-
Scripts/Mobiles/AI/BaseAI.cs | 23 ++-
Scripts/Mobiles/BaseCreature.cs | 2 +-
.../Mobiles/Monsters/LBR/Meers/MeerMage.cs | 3 +-
Scripts/Mobiles/PlayerMobile.cs | 18 +-
Scripts/Mobiles/Special/Harrower.cs | 2 +-
Scripts/Mobiles/Townfolk/Banker.cs | 2 +-
Scripts/Mobiles/Vendors/GenericBuy.cs | 2 +-
Scripts/Mobiles/Vendors/NPC/AnimalTrainer.cs | 2 +-
.../NPC/Guildmasters/BaseGuildmaster.cs | 2 +-
Scripts/Mobiles/Vendors/PlayerBarkeeper.cs | 6 +-
Scripts/Multis/BaseHouse.cs | 2 +-
Scripts/Multis/HouseSign.cs | 2 +-
Scripts/Skills/AnimalLore.cs | 14 +-
Scripts/Skills/Snooping.cs | 2 +-
Scripts/Skills/Stealing.cs | 2 +-
Scripts/SpecialSystems/Engines/TestCenter.cs | 2 +-
Scripts/Spells/Base/SpecialMove.cs | 2 +-
Scripts/Spells/Base/SpellHelper.cs | 4 +-
Scripts/Spells/Base/SpellRegistry.cs | 2 +-
Scripts/Spells/Bushido/SamuraiSpell.cs | 2 +-
Scripts/Spells/First/ReactiveArmor.cs | 2 +-
Scripts/Spells/Fourth/Curse.cs | 2 +-
Scripts/Spells/Mysticism/MysticSpell.cs | 2 +-
Scripts/Spells/Mysticism/StoneFormSpell.cs | 2 +-
Scripts/Spells/Necromancy/Strangle.cs | 2 +-
Scripts/Spells/Necromancy/SummonFamiliar.cs | 5 +-
Scripts/Spells/Ninjitsu/AnimalForm.cs | 2 +-
Scripts/Spells/Ninjitsu/NinjaSpell.cs | 2 +-
Scripts/Spells/Second/Protection.cs | 2 +-
Scripts/Spells/Spellweaving/ArcanistSpell.cs | 2 +-
Scripts/Spells/Spellweaving/AttuneWeapon.cs | 2 +-
Scripts/Spells/Spellweaving/EssenceOfWind.cs | 3 +-
.../Spellweaving/Items/TransientItem.cs | 5 +-
Scripts/Spells/Third/Bless.cs | 2 +-
Server/Body.cs | 2 +-
Server/Diagnostics/PacketProfile.cs | 2 +-
Server/Geometry.cs | 6 +-
Server/Guild.cs | 2 +-
Server/Gumps/GumpAlphaRegion.cs | 2 +-
Server/Gumps/GumpBackground.cs | 2 +-
Server/Gumps/GumpButton.cs | 2 +-
Server/Gumps/GumpCheck.cs | 2 +-
Server/Gumps/GumpGroup.cs | 2 +-
Server/Gumps/GumpHtml.cs | 3 +-
Server/Gumps/GumpHtmlLocalized.cs | 9 +-
Server/Gumps/GumpImage.cs | 4 +-
Server/Gumps/GumpImageTileButton.cs | 6 +-
Server/Gumps/GumpImageTiled.cs | 2 +-
Server/Gumps/GumpItem.cs | 4 +-
Server/Gumps/GumpItemProperty.cs | 2 +-
Server/Gumps/GumpLabel.cs | 2 +-
Server/Gumps/GumpLabelCropped.cs | 2 +-
Server/Gumps/GumpPage.cs | 2 +-
Server/Gumps/GumpRadio.cs | 2 +-
Server/Gumps/GumpTextEntry.cs | 3 +-
Server/Gumps/GumpTextEntryLimited.cs | 3 +-
Server/Gumps/GumpTooltip.cs | 2 +-
Server/Item.cs | 5 +-
Server/Items/Containers.cs | 3 +-
Server/Items/VirtualCheck.cs | 8 +-
Server/ScriptCompiler.cs | 8 +-
Server/Serial.cs | 2 +-
Server/Skills.cs | 2 +-
Server/TileData.cs | 2 +-
Server/Timer.cs | 8 +-
Server/World.cs | 13 +-
233 files changed, 758 insertions(+), 690 deletions(-)
diff --git a/Scripts/Accounting/AccountHandler.cs b/Scripts/Accounting/AccountHandler.cs
index 0e47e05cd..656f32894 100644
--- a/Scripts/Accounting/AccountHandler.cs
+++ b/Scripts/Accounting/AccountHandler.cs
@@ -155,7 +155,8 @@ namespace Server.Misc
* Please check your Journal for messages every few minutes.
*/
- PageQueue.Enqueue( new PageEntry( from, String.Format( "[Automated: Change Password]
Desired password: {0}
Current IP address: {1}
Account IP address: {2}", pass, ipAddress, accessList[0] ), PageType.Account ) );
+ PageQueue.Enqueue( new PageEntry( from,
+ $"[Automated: Change Password]
Desired password: {pass}
Current IP address: {ipAddress}
Account IP address: {accessList[0]}", PageType.Account ) );
}
}
@@ -207,7 +208,7 @@ namespace Server.Misc
{
Console.WriteLine( "Client: {0}: Deleting character {1} (0x{2:X})", state, index, m.Serial.Value );
- acct.Comments.Add( new AccountComment( "System", String.Format( "Character #{0} {1} deleted by {2}", index + 1, m, state ) ) );
+ acct.Comments.Add( new AccountComment( "System", $"Character #{index + 1} {m} deleted by {state}") );
m.Delete();
state.Send( new CharacterListUpdate( acct ) );
diff --git a/Scripts/Accounting/Firewall.cs b/Scripts/Accounting/Firewall.cs
index ff37321c9..9abc61493 100644
--- a/Scripts/Accounting/Firewall.cs
+++ b/Scripts/Accounting/Firewall.cs
@@ -74,7 +74,7 @@ namespace Server
public override string ToString()
{
- return String.Format( "{0}/{1}", m_CIDRPrefix, m_CIDRLength );
+ return $"{m_CIDRPrefix}/{m_CIDRLength}";
}
public override bool Equals( object obj )
diff --git a/Scripts/Commands/Decorate.cs b/Scripts/Commands/Decorate.cs
index 589ecb5c0..c4fb38bc2 100644
--- a/Scripts/Commands/Decorate.cs
+++ b/Scripts/Commands/Decorate.cs
@@ -385,7 +385,7 @@ namespace Server.Commands
}
catch ( Exception e )
{
- throw new Exception( String.Format( "Bad type: {0}", m_Type ), e );
+ throw new Exception($"Bad type: {m_Type}", e );
}
if ( item is BaseAddon addon )
@@ -1061,7 +1061,7 @@ namespace Server.Commands
list.m_Type = ScriptCompiler.FindTypeByName( line.Substring( 0, indexOf++ ), true );
if ( list.m_Type == null )
- throw new ArgumentException( String.Format( "Type not found for header: '{0}'", line ) );
+ throw new ArgumentException($"Type not found for header: '{line}'");
line = line.Substring( indexOf );
indexOf = line.IndexOf( '(' );
diff --git a/Scripts/Commands/DecorateMag.cs b/Scripts/Commands/DecorateMag.cs
index ba7c8d0fa..f2a540b14 100644
--- a/Scripts/Commands/DecorateMag.cs
+++ b/Scripts/Commands/DecorateMag.cs
@@ -382,7 +382,7 @@ namespace Server.Commands
}
catch ( Exception e )
{
- throw new Exception( String.Format( "Bad type: {0}", m_Type ), e );
+ throw new Exception($"Bad type: {m_Type}", e );
}
if ( item is BaseAddon addon )
@@ -1058,7 +1058,7 @@ namespace Server.Commands
list.m_Type = ScriptCompiler.FindTypeByName( line.Substring( 0, indexOf++ ), true );
if ( list.m_Type == null )
- throw new ArgumentException( String.Format( "Type not found for header: '{0}'", line ) );
+ throw new ArgumentException($"Type not found for header: '{line}'");
line = line.Substring( indexOf );
indexOf = line.IndexOf( '(' );
diff --git a/Scripts/Commands/Docs.cs b/Scripts/Commands/Docs.cs
index 9fa24a9b9..c32636a7d 100644
--- a/Scripts/Commands/Docs.cs
+++ b/Scripts/Commands/Docs.cs
@@ -982,7 +982,7 @@ namespace Server.Commands
break;
}
- html.WriteLine( "
| ", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
+ html.WriteLine( " | ", count*25, count==1?"": $" colspan=\"{count}\"");
}
}
@@ -998,7 +998,7 @@ namespace Server.Commands
lbod.Entries = LargeBulkEntry.ConvertEntries( lbod, entries );
- WriteSmithBODHeader( html, String.Format( "(Large) {0}: Normal", name ) );
+ WriteSmithBODHeader( html, $"(Large) {name}: Normal");
lbod.RequireExceptional = false;
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
@@ -1012,7 +1012,7 @@ namespace Server.Commands
html.WriteLine( "
" );
- WriteSmithBODHeader( html, String.Format( "(Large) {0}: Exceptional", name ) );
+ WriteSmithBODHeader( html, $"(Large) {name}: Exceptional");
lbod.RequireExceptional = true;
for( BulkMaterialType mat = BulkMaterialType.None; mat <= BulkMaterialType.Valorite; ++mat )
@@ -1205,7 +1205,7 @@ namespace Server.Commands
break;
}
- html.WriteLine( " | ", count*25, count==1?"":String.Format( " colspan=\"{0}\"", count ) );
+ html.WriteLine( " | ", count*25, count==1?"": $" colspan=\"{count}\"");
}
}
diff --git a/Scripts/Commands/GenCategorization.cs b/Scripts/Commands/GenCategorization.cs
index a9fdeb555..91567611f 100644
--- a/Scripts/Commands/GenCategorization.cs
+++ b/Scripts/Commands/GenCategorization.cs
@@ -332,14 +332,14 @@ namespace Server.Commands
int start = text.IndexOf( '(' );
if ( start < 0 )
- throw new FormatException( String.Format( "Input string not correctly formatted ('{0}')", text ) );
+ throw new FormatException($"Input string not correctly formatted ('{text}')");
m_Title = text.Substring( 0, start ).Trim();
int end = text.IndexOf( ')', ++start );
if ( end < start )
- throw new FormatException( String.Format( "Input string not correctly formatted ('{0}')", text ) );
+ throw new FormatException($"Input string not correctly formatted ('{text}')");
text = text.Substring( start, end-start );
string[] split = text.Split( ';' );
@@ -392,7 +392,7 @@ namespace Server.Commands
}
if ( index >= input.Length )
- throw new FormatException( String.Format( "Input string not correctly formatted ('{0}')", input ) );
+ throw new FormatException($"Input string not correctly formatted ('{input}')");
m_Indentation = index;
m_Text = input.Substring( index );
diff --git a/Scripts/Commands/Generic/Commands/BaseCommand.cs b/Scripts/Commands/Generic/Commands/BaseCommand.cs
index e8a11d839..cca26d9b1 100644
--- a/Scripts/Commands/Generic/Commands/BaseCommand.cs
+++ b/Scripts/Commands/Generic/Commands/BaseCommand.cs
@@ -116,7 +116,7 @@ namespace Server.Commands.Generic
public override string ToString()
{
if ( m_Count > 1 )
- return String.Format( "{0} ({1})", m_Message, m_Count );
+ return $"{m_Message} ({m_Count})";
return m_Message;
}
diff --git a/Scripts/Commands/Generic/Commands/Commands.cs b/Scripts/Commands/Generic/Commands/Commands.cs
index bc6b562cc..ca747e6d6 100644
--- a/Scripts/Commands/Generic/Commands/Commands.cs
+++ b/Scripts/Commands/Generic/Commands/Commands.cs
@@ -190,7 +190,7 @@ namespace Server.Commands.Generic
if ( list.Count == 1 )
AddResponse( "There is one matching object." );
else
- AddResponse( String.Format( "There are {0} matching objects.", list.Count ) );
+ AddResponse($"There are {list.Count} matching objects.");
}
}
@@ -255,7 +255,8 @@ namespace Server.Commands.Generic
else
AddResponse( "Open web browser request sent." );
- mob.SendGump( new WarningGump( 1060637, 30720, String.Format( "A game master is requesting to open your web browser to the following URL:
{0}", url ), 0xFFC000, 320, 240, new WarningGumpCallback( OpenBrowser_Callback ), new object[]{ from, url, echo } ) );
+ mob.SendGump( new WarningGump( 1060637, 30720,
+ $"A game master is requesting to open your web browser to the following URL:
{url}", 0xFFC000, 320, 240, new WarningGumpCallback( OpenBrowser_Callback ), new object[]{ from, url, echo } ) );
}
}
else
@@ -636,9 +637,9 @@ namespace Server.Commands.Generic
Type type = obj.GetType();
if ( type.DeclaringType == null )
- AddResponse( String.Format( "The type of that object is {0}.", type.Name ) );
+ AddResponse($"The type of that object is {type.Name}.");
else
- AddResponse( String.Format( "The type of that object is {0}.", type.FullName ) );
+ AddResponse($"The type of that object is {type.FullName}.");
}
}
}
@@ -698,7 +699,7 @@ namespace Server.Commands.Generic
Commands = new[]{ command };
ObjectTypes = objects;
Usage = command;
- Description = String.Format( "Sets the {0} property to {1}.", name, value );
+ Description = $"Sets the {name} property to {value}.";
}
public override void Execute( CommandEventArgs e, object obj )
@@ -796,7 +797,8 @@ namespace Server.Commands.Generic
{
if ( list.Count > 1 )
{
- e.Mobile.SendGump( new WarningGump( 1060637, 30720, String.Format( "You are about to delete {0} objects. This cannot be undone without a full server revert.
Continue?", list.Count ), 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[]{ e, list } ) );
+ e.Mobile.SendGump( new WarningGump( 1060637, 30720,
+ $"You are about to delete {list.Count} objects. This cannot be undone without a full server revert.
Continue?", 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[]{ e, list } ) );
AddResponse( "Awaiting confirmation..." );
}
else
@@ -1043,7 +1045,7 @@ namespace Server.Commands.Generic
targ.Say( "I've been {0}!", m_Ban ? "banned" : "kicked" );
- AddResponse( String.Format( "They have been {0}.", m_Ban ? "banned" : "kicked" ) );
+ AddResponse($"They have been {(m_Ban ? "banned" : "kicked")}.");
targState.Dispose();
diff --git a/Scripts/Commands/Generic/Commands/DesignInsert.cs b/Scripts/Commands/Generic/Commands/DesignInsert.cs
index 304255a12..c5e4f1d03 100644
--- a/Scripts/Commands/Generic/Commands/DesignInsert.cs
+++ b/Scripts/Commands/Generic/Commands/DesignInsert.cs
@@ -95,7 +95,8 @@ namespace Server.Commands.Generic
#region Area targeting mode
public override void ExecuteList( CommandEventArgs e, ArrayList list )
{
- e.Mobile.SendGump( new WarningGump( 1060637, 30720, String.Format( "You are about to insert {0} objects. This cannot be undone without a full server revert.
Continue?", list.Count ), 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[] { e, list, ( e.Length < 1 || !e.GetBoolean( 0 ) ) } ) );
+ e.Mobile.SendGump( new WarningGump( 1060637, 30720,
+ $"You are about to insert {list.Count} objects. This cannot be undone without a full server revert.
Continue?", 0xFFC000, 420, 280, new WarningGumpCallback( OnConfirmCallback ), new object[] { e, list, ( e.Length < 1 || !e.GetBoolean( 0 ) ) } ) );
AddResponse( "Awaiting confirmation..." );
}
diff --git a/Scripts/Commands/Generic/Commands/Interface.cs b/Scripts/Commands/Generic/Commands/Interface.cs
index 2d25aec82..362193103 100644
--- a/Scripts/Commands/Generic/Commands/Interface.cs
+++ b/Scripts/Commands/Generic/Commands/Interface.cs
@@ -85,7 +85,8 @@ namespace Server.Commands.Generic
else
AddEntryHeader( 20 );
- AddEntryHtml( 40 + ( m_Columns.Length * 130 ) - 20 + ( ( m_Columns.Length - 2 ) * OffsetSize ), Center( String.Format( "Page {0} of {1}", m_Page+1, (m_List.Count + EntriesPerPage - 1) / EntriesPerPage ) ) );
+ AddEntryHtml( 40 + ( m_Columns.Length * 130 ) - 20 + ( ( m_Columns.Length - 2 ) * OffsetSize ), Center(
+ $"Page {m_Page + 1} of {(m_List.Count + EntriesPerPage - 1) / EntriesPerPage}") );
if ( (m_Page + 1) * EntriesPerPage < m_List.Count )
AddEntryButton( 20, ArrowRightID1, ArrowRightID2, 2, ArrowRightWidth, ArrowRightHeight );
@@ -297,7 +298,7 @@ namespace Server.Commands.Generic
private void InvokeCommand( string ip )
{
- CommandSystem.Handle( m_From, String.Format( "{0}{1}", CommandSystem.Prefix, ip ) );
+ CommandSystem.Handle( m_From, $"{CommandSystem.Prefix}{ip}");
}
public override void OnResponse( NetState sender, RelayInfo info )
@@ -338,7 +339,7 @@ namespace Server.Commands.Generic
case 4: // Go there
{
m_From.SendGump( new InterfaceItemGump( m_From, m_Columns, m_List, m_Page, m_Item ) );
- InvokeCommand( String.Format( "Go {0}", m_Item.Serial.Value ) );
+ InvokeCommand($"Go {m_Item.Serial.Value}");
break;
}
case 5: // Move to target
@@ -458,7 +459,7 @@ namespace Server.Commands.Generic
private void InvokeCommand( string ip )
{
- CommandSystem.Handle( m_From, String.Format( "{0}{1}", CommandSystem.Prefix, ip ) );
+ CommandSystem.Handle( m_From, $"{CommandSystem.Prefix}{ip}");
}
public override void OnResponse( NetState sender, RelayInfo info )
@@ -503,7 +504,7 @@ namespace Server.Commands.Generic
case 4: // Go there
{
m_From.SendGump( new InterfaceMobileGump( m_From, m_Columns, m_List, m_Page, m_Mobile ) );
- InvokeCommand( String.Format( "Go {0}", m_Mobile.Serial.Value ) );
+ InvokeCommand($"Go {m_Mobile.Serial.Value}");
break;
}
case 5: // Bring them here
diff --git a/Scripts/Commands/Generic/Extensions/Compilers/ConditionalCompiler.cs b/Scripts/Commands/Generic/Extensions/Compilers/ConditionalCompiler.cs
index f4ff1fcc0..2078c7006 100644
--- a/Scripts/Commands/Generic/Extensions/Compilers/ConditionalCompiler.cs
+++ b/Scripts/Commands/Generic/Extensions/Compilers/ConditionalCompiler.cs
@@ -177,11 +177,7 @@ namespace Server.Commands.Generic
else
{
throw new InvalidOperationException(
- String.Format(
- "Unable to convert string \"{0}\" into type '{1}'.",
- m_Value,
- m_Type
- )
+ $"Unable to convert string \"{m_Value}\" into type '{m_Type}'."
);
}
}
diff --git a/Scripts/Commands/Generic/Implementors/ObjectConditional.cs b/Scripts/Commands/Generic/Implementors/ObjectConditional.cs
index cdc70dc4c..613427f20 100644
--- a/Scripts/Commands/Generic/Implementors/ObjectConditional.cs
+++ b/Scripts/Commands/Generic/Implementors/ObjectConditional.cs
@@ -94,7 +94,7 @@ namespace Server.Commands.Generic
Type objectType = ScriptCompiler.FindTypeByName( args[offset + index], true );
if ( objectType == null )
- throw new Exception( String.Format( "No type with that name ({0}) was found.", args[offset + index] ) );
+ throw new Exception($"No type with that name ({args[offset + index]}) was found.");
++index;
@@ -231,7 +231,7 @@ namespace Server.Commands.Generic
}
if ( condition == null )
- throw new InvalidOperationException( String.Format( "Unrecognized operator (\"{0}\").", oper ) );
+ throw new InvalidOperationException($"Unrecognized operator (\"{oper}\").");
current.Add( condition );
}
diff --git a/Scripts/Commands/Handlers.cs b/Scripts/Commands/Handlers.cs
index e194bdb36..25702c574 100644
--- a/Scripts/Commands/Handlers.cs
+++ b/Scripts/Commands/Handlers.cs
@@ -233,8 +233,7 @@ namespace Server.Commands
e.Mobile.SendGump(
new WarningGump( 1060635, 30720,
- String.Format( "You are about to delete {0} object{1} from this facet. Do you really wish to continue?",
- list.Count, list.Count == 1 ? "" : "s" ),
+ $"You are about to delete {list.Count} object{(list.Count == 1 ? "" : "s")} from this facet. Do you really wish to continue?",
0xFFC000, 360, 260, new WarningGumpCallback( DeleteList_Callback ), list ) );
}
else
@@ -345,7 +344,7 @@ namespace Server.Commands
{
Item item = m.Items[i];
- entries[i] = new ItemListEntry( String.Format( "{0}: {1}", item.Layer, item.GetType().Name ), item.ItemID, item.Hue );
+ entries[i] = new ItemListEntry($"{item.Layer}: {item.GetType().Name}", item.ItemID, item.Hue );
}
return entries;
@@ -377,7 +376,7 @@ namespace Server.Commands
private Mobile m_Mobile;
private Item m_Item;
- public EquipDetailsMenu( Mobile m, Item item ) : base( String.Format( "{0}: {1}", item.Layer, item.GetType().Name ), new[]{"Move","Delete","Props"})
+ public EquipDetailsMenu( Mobile m, Item item ) : base($"{item.Layer}: {item.GetType().Name}", new[]{"Move","Delete","Props"})
{
m_Mobile = m;
m_Item = item;
@@ -828,7 +827,7 @@ namespace Server.Commands
[Description( "Broadcasts a message to all online staff." )]
public static void StaffMessage_OnCommand( CommandEventArgs e )
{
- BroadcastMessage( AccessLevel.Counselor, e.Mobile.SpeechHue, String.Format( "[{0}] {1}", e.Mobile.Name, e.ArgString ) );
+ BroadcastMessage( AccessLevel.Counselor, e.Mobile.SpeechHue, $"[{e.Mobile.Name}] {e.ArgString}");
}
[Usage( "BCast " )]
@@ -836,7 +835,7 @@ namespace Server.Commands
[Description( "Broadcasts a message to everyone online." )]
public static void BroadcastMessage_OnCommand( CommandEventArgs e )
{
- BroadcastMessage( AccessLevel.Player, 0x482, String.Format( "Staff message from {0}:", e.Mobile.Name ) );
+ BroadcastMessage( AccessLevel.Player, 0x482, $"Staff message from {e.Mobile.Name}:");
BroadcastMessage( AccessLevel.Player, 0x482, e.ArgString );
}
diff --git a/Scripts/Commands/HelpInfo.cs b/Scripts/Commands/HelpInfo.cs
index ab4ed3a88..d8ec60239 100644
--- a/Scripts/Commands/HelpInfo.cs
+++ b/Scripts/Commands/HelpInfo.cs
@@ -46,7 +46,7 @@ namespace Server.Commands
return;
}
else
- e.Mobile.SendMessage( String.Format( "Command '{0}' not found!", arg ) );
+ e.Mobile.SendMessage($"Command '{arg}' not found!");
}
e.Mobile.SendGump( new CommandListGump( 0, e.Mobile, null ) );
@@ -255,7 +255,8 @@ namespace Server.Commands
else
AddEntryHeader( 20 );
- AddEntryHtml( 160, Center( String.Format( "Page {0} of {1}", m_Page+1, (m_List.Count + EntriesPerPage - 1) / EntriesPerPage ) ) );
+ AddEntryHtml( 160, Center(
+ $"Page {m_Page + 1} of {(m_List.Count + EntriesPerPage - 1) / EntriesPerPage}") );
if ( (m_Page + 1) * EntriesPerPage < m_List.Count )
AddEntryButton( 20, ArrowRightID1, ArrowRightID2, 2, ArrowRightWidth, ArrowRightHeight );
@@ -346,12 +347,12 @@ namespace Server.Commands
{
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public CommandInfoGump( CommandInfo info )
@@ -384,7 +385,7 @@ namespace Server.Commands
if ( aliases != null && aliases.Length != 0 )
{
- sb.Append( String.Format( "Alias{0}: ", aliases.Length == 1 ? "" : "es" ) );
+ sb.Append($"Alias{(aliases.Length == 1 ? "" : "es")}: ");
for( int i = 0; i < aliases.Length; ++i )
{
diff --git a/Scripts/Commands/Logging.cs b/Scripts/Commands/Logging.cs
index 6166829a0..df1bd10fd 100644
--- a/Scripts/Commands/Logging.cs
+++ b/Scripts/Commands/Logging.cs
@@ -29,7 +29,7 @@ namespace Server.Commands
try
{
- m_Output = new StreamWriter( Path.Combine( directory, String.Format( "{0}.log", DateTime.UtcNow.ToLongDateString() ) ), true );
+ m_Output = new StreamWriter( Path.Combine( directory, $"{DateTime.UtcNow.ToLongDateString()}.log"), true );
m_Output.AutoFlush = true;
@@ -47,13 +47,13 @@ namespace Server.Commands
if ( o is Mobile m )
{
if ( m.Account == null )
- return String.Format( "{0} (no account)", m );
+ return $"{m} (no account)";
- return String.Format( "{0} ('{1}')", m, m.Account.Username );
+ return $"{m} ('{m.Account.Username}')";
}
if ( o is Item item )
{
- return String.Format( "0x{0:X} ({1})", item.Serial.Value, item.GetType().Name );
+ return $"0x{item.Serial.Value:X} ({item.GetType().Name})";
}
return o;
@@ -83,7 +83,7 @@ namespace Server.Commands
AppendPath( ref path, "Logs" );
AppendPath( ref path, "Commands" );
AppendPath( ref path, from.AccessLevel.ToString() );
- path = Path.Combine( path, String.Format( "{0}.log", name ) );
+ path = Path.Combine( path, $"{name}.log");
using ( StreamWriter sw = new StreamWriter( path, true ) )
sw.WriteLine( "{0}: {1}: {2}", DateTime.UtcNow, from.NetState, text );
diff --git a/Scripts/Commands/Properties.cs b/Scripts/Commands/Properties.cs
index 89cccc830..fcfb4f91d 100644
--- a/Scripts/Commands/Properties.cs
+++ b/Scripts/Commands/Properties.cs
@@ -110,31 +110,31 @@ namespace Server.Commands
if ( attr == null )
{
- failReason = String.Format( "Property '{0}' not found.", propertyName );
+ failReason = $"Property '{propertyName}' not found.";
return null;
}
else if ( (access & PropertyAccess.Read) != 0 && from.AccessLevel < attr.ReadLevel )
{
- failReason = String.Format( "You must be at least {0} to get the property '{1}'.",
- Mobile.GetAccessLevelName( attr.ReadLevel ), propertyName );
+ failReason =
+ $"You must be at least {Mobile.GetAccessLevelName(attr.ReadLevel)} to get the property '{propertyName}'.";
return null;
}
else if ( (access & PropertyAccess.Write) != 0 && from.AccessLevel < attr.WriteLevel )
{
- failReason = String.Format( "You must be at least {0} to set the property '{1}'.",
- Mobile.GetAccessLevelName( attr.WriteLevel ), propertyName );
+ failReason =
+ $"You must be at least {Mobile.GetAccessLevelName(attr.WriteLevel)} to set the property '{propertyName}'.";
return null;
}
else if ( (access & PropertyAccess.Read) != 0 && !p.CanRead )
{
- failReason = String.Format( "Property '{0}' is write only.", propertyName );
+ failReason = $"Property '{propertyName}' is write only.";
return null;
}
else if ( (access & PropertyAccess.Write) != 0 && (!p.CanWrite || attr.ReadOnly) && isFinal )
{
- failReason = String.Format( "Property '{0}' is read only.", propertyName );
+ failReason = $"Property '{propertyName}' is read only.";
return null;
}
@@ -146,7 +146,7 @@ namespace Server.Commands
if ( info[i] == null )
{
- failReason = String.Format( "Property '{0}' not found.", propertyName );
+ failReason = $"Property '{propertyName}' not found.";
return null;
}
}
@@ -181,7 +181,7 @@ namespace Server.Commands
if ( obj == null )
{
- failReason = String.Format( "Property '{0}' is null.", chain[i] );
+ failReason = $"Property '{chain[i]}' is null.";
return null;
}
}
@@ -313,14 +313,14 @@ namespace Server.Commands
else if ( IsChar( type ) )
toString = String.Format( "'{0}' ({1} [0x{1:X}])", value, (int) value );
else if ( IsString( type ) )
- toString = ( (string) value == "null" ? @"@""null""" : String.Format( "\"{0}\"", value ) );
+ toString = ( (string) value == "null" ? @"@""null""" : $"\"{value}\"");
else if ( IsText( type ) )
toString = ( (TextDefinition) value ).Format( false );
else
toString = value.ToString();
if ( chain == null )
- return String.Format( "{0} = {1}", p.Name, toString );
+ return $"{p.Name} = {toString}";
string[] concat = new string[chain.Length*2+1];
@@ -615,7 +615,7 @@ namespace Server
public sealed class UnknownPropertyException : BindingException
{
public UnknownPropertyException( Property property, string current )
- : base( property, String.Format( "Property '{0}' not found.", current ) )
+ : base( property, $"Property '{current}' not found.")
{
}
}
@@ -662,11 +662,8 @@ namespace Server
public AccessLevel NeededAccess => m_NeededAccess;
public ClearanceException( Property property, AccessLevel playerAccess, AccessLevel neededAccess, string accessType )
- : base( property, string.Format(
- "You must be at least {0} to {1} this property.",
- Mobile.GetAccessLevelName( neededAccess ),
- accessType
- ) )
+ : base( property,
+ $"You must be at least {Mobile.GetAccessLevelName(neededAccess)} to {accessType} this property.")
{
}
}
diff --git a/Scripts/Commands/Skills.cs b/Scripts/Commands/Skills.cs
index 004467d5d..3b8c93fcb 100644
--- a/Scripts/Commands/Skills.cs
+++ b/Scripts/Commands/Skills.cs
@@ -128,7 +128,7 @@ namespace Server.Commands
if ( m_Set )
{
skill.Base = m_Value;
- CommandLogging.LogChangeProperty( from, targ, String.Format( "{0}.Base", m_Skill ), m_Value.ToString() );
+ CommandLogging.LogChangeProperty( from, targ, $"{m_Skill}.Base", m_Value.ToString() );
}
from.SendMessage( "{0} : {1} (Base: {2})", m_Skill, skill.Value, skill.Base );
diff --git a/Scripts/Commands/Statics.cs b/Scripts/Commands/Statics.cs
index 976c4ef04..9414a9e9b 100644
--- a/Scripts/Commands/Statics.cs
+++ b/Scripts/Commands/Statics.cs
@@ -272,7 +272,8 @@ namespace Server
if ( totalFrozen == 0 && badDataFile )
from.SendGump( new NoticeGump( 1060637, 30720, "Output data files could not be opened and the freeze operation has been aborted.
This probably means your server and client are using the same data files. Instructions on how to resolve this can be found in the first warning window.", 0xFFC000, 320, 240, null, null ) );
else
- from.SendGump( new NoticeGump( 1060637, 30720, String.Format( "Freeze operation completed successfully.
{0} item{1} frozen.
You must restart your client and update it's data files to see the changes.", totalFrozen, totalFrozen != 1 ? "s were" : " was" ), 0xFFC000, 320, 240, null, null ) );
+ from.SendGump( new NoticeGump( 1060637, 30720,
+ $"Freeze operation completed successfully.
{totalFrozen} item{(totalFrozen != 1 ? "s were" : " was")} frozen.
You must restart your client and update it's data files to see the changes.", 0xFFC000, 320, 240, null, null ) );
}
private const string BaseUnfreezeWarning = "{0} " +
@@ -470,7 +471,8 @@ namespace Server
if ( totalUnfrozen == 0 && badDataFile )
from.SendGump( new NoticeGump( 1060637, 30720, "Output data files could not be opened and the unfreeze operation has been aborted.
This probably means your server and client are using the same data files. Instructions on how to resolve this can be found in the first warning window.", 0xFFC000, 320, 240, null, null ) );
else
- from.SendGump( new NoticeGump( 1060637, 30720, String.Format( "Unfreeze operation completed successfully.
{0} item{1} unfrozen.
You must restart your client and update it's data files to see the changes.", totalUnfrozen, totalUnfrozen != 1 ? "s were" : " was" ), 0xFFC000, 320, 240, null, null ) );
+ from.SendGump( new NoticeGump( 1060637, 30720,
+ $"Unfreeze operation completed successfully.
{totalUnfrozen} item{(totalUnfrozen != 1 ? "s were" : " was")} unfrozen.
You must restart your client and update it's data files to see the changes.", 0xFFC000, 320, 240, null, null ) );
}
private static FileStream OpenWrite( FileStream orig )
diff --git a/Scripts/Engines/BulkOrders/Books/BOBGump.cs b/Scripts/Engines/BulkOrders/Books/BOBGump.cs
index 3b0e1b6a4..33563a0bc 100644
--- a/Scripts/Engines/BulkOrders/Books/BOBGump.cs
+++ b/Scripts/Engines/BulkOrders/Books/BOBGump.cs
@@ -655,7 +655,7 @@ namespace Server.Engines.BulkOrders
else
AddLabel( 316, y, 1152, name.ToString() );
- AddLabel( 421, y, 1152, String.Format( "{0} / {1}", sub.AmountCur, entry.AmountMax ) );
+ AddLabel( 421, y, 1152, $"{sub.AmountCur} / {entry.AmountMax}");
++tableIndex;
y += 32;
@@ -692,7 +692,7 @@ namespace Server.Engines.BulkOrders
else
AddLabel( 316, y, 1152, name.ToString() );
- AddLabel( 421, y, 1152, String.Format( "{0} / {1}", smallEntry.AmountCur, smallEntry.AmountMax ) );
+ AddLabel( 421, y, 1152, $"{smallEntry.AmountCur} / {smallEntry.AmountMax}");
}
}
}
diff --git a/Scripts/Engines/BulkOrders/SmallBulkEntry.cs b/Scripts/Engines/BulkOrders/SmallBulkEntry.cs
index c04fde623..58614c409 100644
--- a/Scripts/Engines/BulkOrders/SmallBulkEntry.cs
+++ b/Scripts/Engines/BulkOrders/SmallBulkEntry.cs
@@ -47,7 +47,7 @@ namespace Server.Engines.BulkOrders
public static SmallBulkEntry[] LoadEntries( string type, string name )
{
- return LoadEntries( String.Format( "Data/Bulk Orders/{0}/{1}.cfg", type, name ) );
+ return LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg");
}
public static SmallBulkEntry[] LoadEntries( string path )
diff --git a/Scripts/Engines/ConPVP/AcceptDuelGump.cs b/Scripts/Engines/ConPVP/AcceptDuelGump.cs
index 43d2dd285..36f456e01 100644
--- a/Scripts/Engines/ConPVP/AcceptDuelGump.cs
+++ b/Scripts/Engines/ConPVP/AcceptDuelGump.cs
@@ -15,12 +15,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private const int LabelColor32 = 0xFFFFFF;
diff --git a/Scripts/Engines/ConPVP/ArenaGump.cs b/Scripts/Engines/ConPVP/ArenaGump.cs
index c50a301fb..f7e128694 100644
--- a/Scripts/Engines/ConPVP/ArenaGump.cs
+++ b/Scripts/Engines/ConPVP/ArenaGump.cs
@@ -248,12 +248,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
diff --git a/Scripts/Engines/ConPVP/BeginGump.cs b/Scripts/Engines/ConPVP/BeginGump.cs
index d2ba62036..3143afa22 100644
--- a/Scripts/Engines/ConPVP/BeginGump.cs
+++ b/Scripts/Engines/ConPVP/BeginGump.cs
@@ -7,12 +7,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private const int LabelColor32 = 0xFFFFFF;
diff --git a/Scripts/Engines/ConPVP/DuelContext.cs b/Scripts/Engines/ConPVP/DuelContext.cs
index fa1c9a177..069f0476b 100644
--- a/Scripts/Engines/ConPVP/DuelContext.cs
+++ b/Scripts/Engines/ConPVP/DuelContext.cs
@@ -459,7 +459,8 @@ namespace Server.Engines.ConPVP
pl.Eliminated = true;
mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have forfeited your position in the duel." );
- mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has forfeited by leaving the dueling arena.", mob.Name ) );
+ mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false,
+ $"{mob.Name} has forfeited by leaving the dueling arena.");
Participant winner = CheckCompletion();
@@ -498,7 +499,7 @@ namespace Server.Engines.ConPVP
else if ( !m_Yielding )
{
mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have been defeated." );
- mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has been defeated.", mob.Name ) );
+ mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, $"{mob.Name} has been defeated.");
}
}
}
@@ -1176,7 +1177,8 @@ namespace Server.Engines.ConPVP
if ( entry == null )
return; // sanity
- string text = String.Format( "{{0}} are ranked {0} at level {1}.", LadderGump.Rank( entry.Index + 1 ), Ladder.GetLevel( entry.Experience ) );
+ string text =
+ $"{{0}} are ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
pm.PrivateOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, from==pm?"You":"They" ), from.NetState );
}
@@ -1267,7 +1269,8 @@ namespace Server.Engines.ConPVP
if ( entry == null )
return; // sanity
- string text = String.Format( "{{0}} {{1}} ranked {0} at level {1}.", LadderGump.Rank( entry.Index + 1 ), Ladder.GetLevel( entry.Experience ) );
+ string text =
+ $"{{0}} {{1}} ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
pm.LocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, "You", "are" ) );
pm.NonlocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, pm.Name, "is" ) );
@@ -1474,7 +1477,7 @@ namespace Server.Engines.ConPVP
else
{
pm.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have yielded." );
- pm.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has yielded.", pm.Name ) );
+ pm.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, $"{pm.Name} has yielded.");
pm.DuelContext.m_Yielding=true;
pm.Kill();
@@ -2325,21 +2328,21 @@ namespace Server.Engines.ConPVP
return "a slot is empty";
if ( dp.Mobile.Region.IsPartOf( typeof( Regions.Jail ) ) )
- return String.Format( "{0} is in jail", dp.Mobile.Name );
+ return $"{dp.Mobile.Name} is in jail";
if ( Sigil.ExistsOn( dp.Mobile ) )
- return String.Format( "{0} is holding a sigil", dp.Mobile.Name );
+ return $"{dp.Mobile.Name} is holding a sigil";
if ( !dp.Mobile.Alive )
{
if ( m_Tournament == null )
- return String.Format( "{0} is dead", dp.Mobile.Name );
+ return $"{dp.Mobile.Name} is dead";
else
dp.Mobile.Resurrect();
}
if ( m_Tournament == null && CheckCombat( dp.Mobile ) )
- return String.Format( "{0} is in combat", dp.Mobile.Name );
+ return $"{dp.Mobile.Name} is in combat";
if ( dp.Mobile.Mounted )
{
@@ -2348,7 +2351,7 @@ namespace Server.Engines.ConPVP
if ( m_Tournament != null && mount != null )
mount.Rider = null;
else
- return String.Format( "{0} is mounted", dp.Mobile.Name );
+ return $"{dp.Mobile.Name} is mounted";
}
}
}
diff --git a/Scripts/Engines/ConPVP/DuelContextGump.cs b/Scripts/Engines/ConPVP/DuelContextGump.cs
index 0e6816e12..8dceb9840 100644
--- a/Scripts/Engines/ConPVP/DuelContextGump.cs
+++ b/Scripts/Engines/ConPVP/DuelContextGump.cs
@@ -14,7 +14,7 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public void AddGoldenButton( int x, int y, int bid )
diff --git a/Scripts/Engines/ConPVP/Games/BombingRun.cs b/Scripts/Engines/ConPVP/Games/BombingRun.cs
index b5e06e540..a5517a35c 100644
--- a/Scripts/Engines/ConPVP/Games/BombingRun.cs
+++ b/Scripts/Engines/ConPVP/Games/BombingRun.cs
@@ -991,12 +991,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
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 );
diff --git a/Scripts/Engines/ConPVP/Games/CTF.cs b/Scripts/Engines/ConPVP/Games/CTF.cs
index c865f7c5d..7c0222ff8 100644
--- a/Scripts/Engines/ConPVP/Games/CTF.cs
+++ b/Scripts/Engines/ConPVP/Games/CTF.cs
@@ -55,12 +55,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
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 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 );
diff --git a/Scripts/Engines/ConPVP/Games/DoubleDom.cs b/Scripts/Engines/ConPVP/Games/DoubleDom.cs
index a2bd93985..c43d194b9 100644
--- a/Scripts/Engines/ConPVP/Games/DoubleDom.cs
+++ b/Scripts/Engines/ConPVP/Games/DoubleDom.cs
@@ -53,12 +53,12 @@ namespace Server.Engines.ConPVP
{
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
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 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 );
diff --git a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs
index 787428772..b6e1aa086 100644
--- a/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs
+++ b/Scripts/Engines/ConPVP/Games/KingOfTheHill.cs
@@ -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("{0}", text);
+ return $"{text}";
}
public string Color(string text, int color)
{
- return String.Format("{1}", color, text);
+ return $"{text}";
}
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);
diff --git a/Scripts/Engines/ConPVP/LadderGump.cs b/Scripts/Engines/ConPVP/LadderGump.cs
index a4048211b..fb99dab64 100644
--- a/Scripts/Engines/ConPVP/LadderGump.cs
+++ b/Scripts/Engines/ConPVP/LadderGump.cs
@@ -219,12 +219,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
diff --git a/Scripts/Engines/ConPVP/ParticipantGump.cs b/Scripts/Engines/ConPVP/ParticipantGump.cs
index b16d3454e..26672460d 100644
--- a/Scripts/Engines/ConPVP/ParticipantGump.cs
+++ b/Scripts/Engines/ConPVP/ParticipantGump.cs
@@ -18,7 +18,7 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public void AddGoldenButton( int x, int y, int bid )
@@ -64,7 +64,7 @@ namespace Server.Engines.ConPVP
int x = 35;
int y = 47;
- AddHtml( x, y, 200, 20, String.Format( "Team Size: {0}", p.Players.Length ), false, false ); y += 22;
+ AddHtml( x, y, 200, 20, $"Team Size: {p.Players.Length}", false, false ); y += 22;
AddGoldenButtonLabeled( x + 20, y, 1, "Increase" ); y += 22;
AddGoldenButtonLabeled( x + 20, y, 2, "Decrease" ); y += 30;
@@ -75,7 +75,7 @@ namespace Server.Engines.ConPVP
{
DuelPlayer pl = p.Players[i];
- AddGoldenButtonLabeled( x, y, 5 + i, String.Format( "{0}: {1}", 1 + i, pl == null ? "Empty" : pl.Mobile.Name ) ); y += 22;
+ AddGoldenButtonLabeled( x, y, 5 + i, $"{1 + i}: {(pl == null ? "Empty" : pl.Mobile.Name)}"); y += 22;
}
}
diff --git a/Scripts/Engines/ConPVP/PickRulesetGump.cs b/Scripts/Engines/ConPVP/PickRulesetGump.cs
index 9a084ca9b..0f9def900 100644
--- a/Scripts/Engines/ConPVP/PickRulesetGump.cs
+++ b/Scripts/Engines/ConPVP/PickRulesetGump.cs
@@ -14,7 +14,7 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public PickRulesetGump( Mobile from, DuelContext context, Ruleset ruleset ) : base( 50, 50 )
diff --git a/Scripts/Engines/ConPVP/Preferences.cs b/Scripts/Engines/ConPVP/Preferences.cs
index ccdf16ced..aa5dc2c81 100644
--- a/Scripts/Engines/ConPVP/Preferences.cs
+++ b/Scripts/Engines/ConPVP/Preferences.cs
@@ -265,12 +265,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
diff --git a/Scripts/Engines/ConPVP/ReadyGump.cs b/Scripts/Engines/ConPVP/ReadyGump.cs
index 610e68b30..9b0f775a9 100644
--- a/Scripts/Engines/ConPVP/ReadyGump.cs
+++ b/Scripts/Engines/ConPVP/ReadyGump.cs
@@ -13,7 +13,7 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public ReadyGump( Mobile from, DuelContext context, int count ) : base( 50, 50 )
@@ -72,7 +72,7 @@ namespace Server.Engines.ConPVP
if ( p.Players.Length > 1 )
{
- AddHtml( 35 + 14, y, 176, 20, String.Format( "Participant #{0}", i + 1 ), false, false );
+ AddHtml( 35 + 14, y, 176, 20, $"Participant #{i + 1}", false, false );
y += 22;
offset = 10;
}
diff --git a/Scripts/Engines/ConPVP/ReadyUpGump.cs b/Scripts/Engines/ConPVP/ReadyUpGump.cs
index 908758f82..86cd9835c 100644
--- a/Scripts/Engines/ConPVP/ReadyUpGump.cs
+++ b/Scripts/Engines/ConPVP/ReadyUpGump.cs
@@ -13,7 +13,7 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public void AddGoldenButton( int x, int y, int bid )
@@ -82,7 +82,7 @@ namespace Server.Engines.ConPVP
if ( p.Players.Length > 1 )
{
- AddHtml( 35, y, 176, 20, String.Format( "Team #{0}", i + 1 ), false, false );
+ AddHtml( 35, y, 176, 20, $"Team #{i + 1}", false, false );
y += 22;
offset = 10;
}
@@ -152,12 +152,12 @@ namespace Server.Engines.ConPVP
AddHtml( 35, 25, 190, 20, Center( "Rules" ), false, false );
- AddHtml( 35, 50, 190, 20, String.Format( "Set: {0}", basedef.Title ), false, false );
+ AddHtml( 35, 50, 190, 20, $"Set: {basedef.Title}", false, false );
y = 70;
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
- AddHtml( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), false, false );
+ AddHtml( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", false, false );
y += 4;
diff --git a/Scripts/Engines/ConPVP/RulesetGump.cs b/Scripts/Engines/ConPVP/RulesetGump.cs
index b619545f5..142f34494 100644
--- a/Scripts/Engines/ConPVP/RulesetGump.cs
+++ b/Scripts/Engines/ConPVP/RulesetGump.cs
@@ -15,7 +15,7 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public void AddGoldenButton( int x, int y, int bid )
diff --git a/Scripts/Engines/ConPVP/Tournament.cs b/Scripts/Engines/ConPVP/Tournament.cs
index 444715cca..f73c1516d 100644
--- a/Scripts/Engines/ConPVP/Tournament.cs
+++ b/Scripts/Engines/ConPVP/Tournament.cs
@@ -91,7 +91,8 @@ namespace Server.Engines.ConPVP
if ( tourny.HasParticipant( m ) )
return;
- PrivateOverheadMessage( MessageType.Regular, 0x35, false, String.Format( "Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord" ), m.NetState );
+ PrivateOverheadMessage( MessageType.Regular, 0x35, false,
+ $"Hello m'{(m.Female ? "Lady" : "Lord")}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.NetState );
m.BeginAction( this );
Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerStateCallback( ReleaseLock_Callback ), m );
}
@@ -299,12 +300,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
@@ -450,7 +451,7 @@ namespace Server.Engines.ConPVP
case GroupingType.Random: groupText = "Random"; break;
}
- AddBorderedText( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $"Grouping: {groupText}", LabelColor32, BlackColor32 );
y += 20;
string tieText = null;
@@ -464,22 +465,22 @@ namespace Server.Engines.ConPVP
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
}
- AddBorderedText( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32 );
y += 20;
string sdText = "Off";
if ( tourny.SuddenDeath > TimeSpan.Zero )
{
- sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
+ sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
if ( tourny.SuddenDeathRounds > 0 )
- sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
+ sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
else
- sdText = String.Format( "{0} (all rounds)", sdText );
+ sdText = $"{sdText} (all rounds)";
}
- AddBorderedText( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32 );
y += 20;
y += 6;
@@ -487,11 +488,11 @@ namespace Server.Engines.ConPVP
AddImageTiled( 42, y+1, 264, 1, 9157 );
y += 6;
- AddBorderedText( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $"Ruleset: {basedef.Title}", LabelColor32, BlackColor32 );
y += 20;
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
- AddBorderedText( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32 );
y += 4;
@@ -642,7 +643,7 @@ namespace Server.Engines.ConPVP
else
{
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x35, false, String.Format( "{0} has not yet proven themselves a worthy dueler.", mob.Name ), from.NetState );
+ 0x35, false, $"{mob.Name} has not yet proven themselves a worthy dueler.", from.NetState );
}
}
@@ -669,7 +670,7 @@ namespace Server.Engines.ConPVP
else
{
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x35, false, String.Format( "{0} has already entered this tournament.", mob.Name ), from.NetState );
+ 0x35, false, $"{mob.Name} has already entered this tournament.", from.NetState );
}
}
@@ -686,7 +687,8 @@ namespace Server.Engines.ConPVP
else
{
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
- 0x35, false, String.Format( "{0} is already assigned to a duel. They must yield it before joining this tournament.", mobile.Name ), from.NetState );
+ 0x35, false,
+ $"{mobile.Name} is already assigned to a duel. They must yield it before joining this tournament.", from.NetState );
}
m_From.SendGump( new ConfirmSignupGump( m_From, m_Registrar, m_Tournament, m_Players ) );
@@ -711,7 +713,7 @@ namespace Server.Engines.ConPVP
if ( minutesUntil == 0 )
timeUntil = "momentarily";
else
- timeUntil = String.Format( "in {0} minute{1}", minutesUntil, minutesUntil == 1 ? "" : "s" );
+ timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}";
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
0x35, false, String.Format( fmt, from.Female ? "Lady" : "Lord", timeUntil ), from.NetState );
@@ -822,7 +824,8 @@ namespace Server.Engines.ConPVP
mob.SendGump( new AcceptTeamGump( from, mob, m_Tournament, m_Registrar, m_Players ) );
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
- 0x59, false, String.Format( "As you command m'{0}. I've given your offer to {1}.", from.Female ? "Lady" : "Lord", mob.Name ), from.NetState );
+ 0x59, false,
+ $"As you command m'{(@from.Female ? "Lady" : "Lord")}. I've given your offer to {mob.Name}.", from.NetState );
}
}
}
@@ -843,12 +846,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
@@ -965,7 +968,7 @@ namespace Server.Engines.ConPVP
AddBorderedText( 22, 22, 294, 20, Center( sb.ToString() ), LabelColor32, BlackColor32 );
AddBorderedText( 22, 50, 294, 40,
- String.Format( "You have been asked to partner with {0} in a tournament. Do you accept?", from.Name ),
+ $"You have been asked to partner with {@from.Name} in a tournament. Do you accept?",
0xB0C868, BlackColor32 );
AddImageTiled( 32, 88, 264, 1, 9107 );
@@ -983,7 +986,7 @@ namespace Server.Engines.ConPVP
case GroupingType.Random: groupText = "Random"; break;
}
- AddBorderedText( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $"Grouping: {groupText}", LabelColor32, BlackColor32 );
y += 20;
string tieText = null;
@@ -997,22 +1000,22 @@ namespace Server.Engines.ConPVP
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
}
- AddBorderedText( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32 );
y += 20;
string sdText = "Off";
if ( tourny.SuddenDeath > TimeSpan.Zero )
{
- sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
+ sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
if ( tourny.SuddenDeathRounds > 0 )
- sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
+ sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
else
- sdText = String.Format( "{0} (all rounds)", sdText );
+ sdText = $"{sdText} (all rounds)";
}
- AddBorderedText( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32 );
y += 20;
y += 6;
@@ -1020,11 +1023,11 @@ namespace Server.Engines.ConPVP
AddImageTiled( 42, y+1, 264, 1, 9157 );
y += 6;
- AddBorderedText( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $"Ruleset: {basedef.Title}", LabelColor32, BlackColor32 );
y += 20;
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
- AddBorderedText( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), LabelColor32, BlackColor32 );
+ AddBorderedText( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32 );
y += 4;
@@ -1092,10 +1095,10 @@ namespace Server.Engines.ConPVP
if ( m_Registrar != null )
{
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x22, false, String.Format( "{0} seems unresponsive.", m_Requested.Name ), m_From.NetState );
+ 0x22, false, $"{m_Requested.Name} seems unresponsive.", m_From.NetState );
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x22, false, String.Format( "You have declined the partnership with {0}.", m_From.Name ), m_Requested.NetState );
+ 0x22, false, $"You have declined the partnership with {m_From.Name}.", m_Requested.NetState );
}
}
@@ -1158,10 +1161,10 @@ namespace Server.Engines.ConPVP
if ( m_Registrar != null )
{
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x59, false, String.Format( "{0} has accepted your offer of partnership.", mob.Name ), from.NetState );
+ 0x59, false, $"{mob.Name} has accepted your offer of partnership.", from.NetState );
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x59, false, String.Format( "You have accepted the partnership with {0}.", from.Name ), mob.NetState );
+ 0x59, false, $"You have accepted the partnership with {@from.Name}.", mob.NetState );
}
}
}
@@ -1175,10 +1178,10 @@ namespace Server.Engines.ConPVP
if ( m_Registrar != null )
{
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x22, false, String.Format( "{0} has declined your offer of partnership.", mob.Name ), from.NetState );
+ 0x22, false, $"{mob.Name} has declined your offer of partnership.", from.NetState );
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
- 0x22, false, String.Format( "You have declined the partnership with {0}.", from.Name ), mob.NetState );
+ 0x22, false, $"You have declined the partnership with {@from.Name}.", mob.NetState );
}
}
}
@@ -2041,9 +2044,11 @@ namespace Server.Engines.ConPVP
try
{
if ( m_EventController != null )
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", m_EventController.GetTeamName( ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) ) ) );
+ Alert( "The tournament has completed!",
+ $"Team {m_EventController.GetTeamName(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner))} has won!");
else if ( m_TournyType == TournyType.RandomTeam )
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
+ Alert( "The tournament has completed!",
+ $"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
else if ( m_TournyType == TournyType.Faction ) {
if ( m_ParticipantsPerMatch == 4 )
{
@@ -2069,21 +2074,25 @@ namespace Server.Engines.ConPVP
}
}
- Alert( "The tournament has completed!", String.Format( "The {0} team has won!", name ) );
+ Alert( "The tournament has completed!", $"The {name} team has won!");
}
else if ( m_ParticipantsPerMatch == 2 )
{
- Alert( "The tournament has completed!", String.Format( "The {0} team has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Evil" : "Hero" ) );
+ Alert( "The tournament has completed!",
+ $"The {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
}
else
{
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
+ Alert( "The tournament has completed!",
+ $"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
}
}
else if ( m_TournyType == TournyType.RedVsBlue )
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Red" : "Blue" ) );
+ Alert( "The tournament has completed!",
+ $"Team {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
else
- Alert( "The tournament has completed!", String.Format( "{0} {1} the champion{2}.", winner.NameList, winner.Players.Count > 1 ? "are" : "is", winner.Players.Count == 1 ? "" : "s" ) );
+ Alert( "The tournament has completed!",
+ $"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
}
catch
{
@@ -2155,9 +2164,11 @@ namespace Server.Engines.ConPVP
try
{
if ( m_EventController != null )
- Alert( "The tournament has completed!", String.Format( "Team {0} has won", m_EventController.GetTeamName( ( (TournyMatch) ( (PyramidLevel) m_Pyramid.Levels[0] ).Matches[0] ).Participants.IndexOf( winner ) ) ) );
+ Alert( "The tournament has completed!",
+ $"Team {m_EventController.GetTeamName(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner))} has won");
else if ( m_TournyType == TournyType.RandomTeam )
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
+ Alert( "The tournament has completed!",
+ $"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
else if ( m_TournyType == TournyType.Faction ) {
if ( m_ParticipantsPerMatch == 4 )
{
@@ -2183,21 +2194,25 @@ namespace Server.Engines.ConPVP
}
}
- Alert( "The tournament has completed!", String.Format( "The {0} team has won!", name ) );
+ Alert( "The tournament has completed!", $"The {name} team has won!");
}
else if ( m_ParticipantsPerMatch == 2 )
{
- Alert( "The tournament has completed!", String.Format( "The {0} team has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Evil" : "Hero" ) );
+ Alert( "The tournament has completed!",
+ $"The {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
}
else
{
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
+ Alert( "The tournament has completed!",
+ $"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
}
}
else if ( m_TournyType == TournyType.RedVsBlue )
- Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Red" : "Blue" ) );
+ Alert( "The tournament has completed!",
+ $"Team {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
else
- Alert( "The tournament has completed!", String.Format( "{0} {1} the champion{2}.", winner.NameList, winner.Players.Count > 1 ? "are" : "is", winner.Players.Count == 1 ? "" : "s" ) );
+ Alert( "The tournament has completed!",
+ $"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
}
catch
{
@@ -2733,12 +2748,12 @@ namespace Server.Engines.ConPVP
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
@@ -2882,11 +2897,12 @@ namespace Server.Engines.ConPVP
secs %= 60;
if ( mins > 0 && secs > 0 )
- text = String.Format( "The tournament will begin in {0} minute{1} and {2} second{3}.", mins, mins==1?"":"s", secs, secs==1?"":"s" );
+ text =
+ $"The tournament will begin in {mins} minute{(mins == 1 ? "" : "s")} and {secs} second{(secs == 1 ? "" : "s")}.";
else if ( mins > 0 )
- text = String.Format( "The tournament will begin in {0} minute{1}.", mins, mins==1?"":"s" );
+ text = $"The tournament will begin in {mins} minute{(mins == 1 ? "" : "s")}.";
else if ( secs > 0 )
- text = String.Format( "The tournament will begin in {0} second{1}.", secs, secs==1?"":"s" );
+ text = $"The tournament will begin in {secs} second{(secs == 1 ? "" : "s")}.";
else
text = "The tournament will begin shortly.";
}
@@ -2950,7 +2966,7 @@ namespace Server.Engines.ConPVP
case GroupingType.Random: groupText = "Random"; break;
}
- AddHtml( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), false, false );
+ AddHtml( 35, y, 190, 20, $"Grouping: {groupText}", false, false );
y += 20;
string tieText = null;
@@ -2964,31 +2980,31 @@ namespace Server.Engines.ConPVP
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
}
- AddHtml( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), false, false );
+ AddHtml( 35, y, 190, 20, $"Tiebreaker: {tieText}", false, false );
y += 20;
string sdText = "Off";
if ( tourny.SuddenDeath > TimeSpan.Zero )
{
- sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
+ sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
if ( tourny.SuddenDeathRounds > 0 )
- sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
+ sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
else
- sdText = String.Format( "{0} (all rounds)", sdText );
+ sdText = $"{sdText} (all rounds)";
}
- AddHtml( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), false, false );
+ AddHtml( 35, y, 240, 20, $"Sudden Death: {sdText}", false, false );
y += 20;
y += 8;
- AddHtml( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), false, false );
+ AddHtml( 35, y, 190, 20, $"Ruleset: {basedef.Title}", false, false );
y += 20;
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
- AddHtml( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), false, false );
+ AddHtml( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", false, false );
y += 4;
@@ -3030,7 +3046,7 @@ namespace Server.Engines.ConPVP
m_List = new ArrayList( tourny.Participants );
AddLeftArrow( 25, 11, ToButtonID( 0, 0 ) );
- AddHtml( 25, 35, 250, 20, Center( String.Format( "{0} Participant{1}", m_List.Count, m_List.Count == 1 ? "" : "s" ) ), false, false );
+ AddHtml( 25, 35, 250, 20, Center($"{m_List.Count} Participant{(m_List.Count == 1 ? "" : "s")}"), false, false );
int index, count, y;
StartPage( out index, out count, out y, 12 );
@@ -3082,7 +3098,8 @@ namespace Server.Engines.ConPVP
y += 18;
}
- AddHtml( 25, y, 200, 20, String.Format( "Free Advances: {0}", part.FreeAdvances == 0 ? "None" : part.FreeAdvances.ToString() ), false, false );
+ AddHtml( 25, y, 200, 20,
+ $"Free Advances: {(part.FreeAdvances == 0 ? "None" : part.FreeAdvances.ToString())}", false, false );
y += 20;
AddHtml( 25, y, 200, 20, "Log:", false, false );
@@ -3119,12 +3136,13 @@ namespace Server.Engines.ConPVP
Ladder ladder = Ladder.Instance;
LadderEntry entry = ladder?.Find( mob );
- AddHtml( 25, 53, 250, 20, String.Format( "Name: {0}", mob.Name ), false, false );
- AddHtml( 25, 73, 250, 20, String.Format( "Guild: {0}", mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]" ), false, false );
- AddHtml( 25, 93, 250, 20, String.Format( "Rank: {0}", entry == null ? "N/A" : LadderGump.Rank( entry.Index + 1 ) ), false, false );
- AddHtml( 25, 113, 250, 20, String.Format( "Level: {0}", entry == null ? 0 : Ladder.GetLevel( entry.Experience ) ), false, false );
- AddHtml( 25, 133, 250, 20, String.Format( "Wins: {0:N0}", entry == null ? 0 : entry.Wins ), false, false );
- AddHtml( 25, 153, 250, 20, String.Format( "Losses: {0:N0}", entry == null ? 0 : entry.Losses ), false, false );
+ AddHtml( 25, 53, 250, 20, $"Name: {mob.Name}", false, false );
+ AddHtml( 25, 73, 250, 20,
+ $"Guild: {(mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]")}", false, false );
+ AddHtml( 25, 93, 250, 20, $"Rank: {(entry == null ? "N/A" : LadderGump.Rank(entry.Index + 1))}", false, false );
+ AddHtml( 25, 113, 250, 20, $"Level: {(entry == null ? 0 : Ladder.GetLevel(entry.Experience))}", false, false );
+ AddHtml( 25, 133, 250, 20, $"Wins: {(entry == null ? 0 : entry.Wins):N0}", false, false );
+ AddHtml( 25, 153, 250, 20, $"Losses: {(entry == null ? 0 : entry.Losses):N0}", false, false );
break;
}
@@ -3165,9 +3183,10 @@ namespace Server.Engines.ConPVP
if ( m_List == null )
m_List = new ArrayList( level.Matches );
- AddRightArrow( 25, 53, ToButtonID( 5, 0 ), String.Format( "Free Advance: {0}", level.FreeAdvance == null ? "None" : level.FreeAdvance.NameList ) );
+ AddRightArrow( 25, 53, ToButtonID( 5, 0 ),
+ $"Free Advance: {(level.FreeAdvance == null ? "None" : level.FreeAdvance.NameList)}");
- AddHtml( 25, 73, 200, 20, String.Format( "{0} Match{1}", m_List.Count, m_List.Count == 1 ? "" : "es" ), false, false );
+ AddHtml( 25, 73, 200, 20, $"{m_List.Count} Match{(m_List.Count == 1 ? "" : "es")}", false, false );
int index, count, y;
StartPage( out index, out count, out y, 10 );
@@ -3214,9 +3233,9 @@ namespace Server.Engines.ConPVP
string txt;
if ( m_Tournament.EventController != null )
- txt = String.Format( "Team {0} ({1})", m_Tournament.EventController.GetTeamName( j ), part.Players.Count );
+ txt = $"Team {m_Tournament.EventController.GetTeamName(j)} ({part.Players.Count})";
else if ( m_Tournament.TournyType == TournyType.RandomTeam )
- txt = String.Format( "Team {0} ({1})", j + 1, part.Players.Count );
+ txt = $"Team {j + 1} ({part.Players.Count})";
else if ( m_Tournament.TournyType == TournyType.Faction ) {
if ( m_Tournament.ParticipantsPerMatch == 4 )
{
@@ -3242,19 +3261,19 @@ namespace Server.Engines.ConPVP
}
}
- txt = String.Format( "{0} ({1})", name, part.Players.Count );
+ txt = $"{name} ({part.Players.Count})";
}
else if ( m_Tournament.ParticipantsPerMatch == 2 )
{
- txt = String.Format( "{0} Team ({1})", j==0?"Evil":"Hero", part.Players.Count );
+ txt = $"{(j == 0 ? "Evil" : "Hero")} Team ({part.Players.Count})";
}
else
{
- txt = String.Format( "Team {0} ({1})", j + 1, part.Players.Count );
+ txt = $"Team {j + 1} ({part.Players.Count})";
}
}
else
- txt = String.Format( "Team {0} ({1})", j == 0 ? "Red" : "Blue", part.Players.Count );
+ txt = $"Team {(j == 0 ? "Red" : "Blue")} ({part.Players.Count})";
if ( color == -1 && match.Context != null && match.Winner == part )
txt = Color( txt, 0x336633 );
@@ -3292,8 +3311,9 @@ namespace Server.Engines.ConPVP
AddLeftArrow( 25, 11, ToButtonID( 0, 5 ) );
AddHtml( 25, 35, 250, 20, Center( "Rounds" ), false, false );
- AddHtml( 25, 53, 250, 20, String.Format( "Winner: {0}", match.Winner == null ? "N/A" : match.Winner.NameList ), false, false );
- AddHtml( 25, 73, 250, 20, String.Format( "State: {0}", match.InProgress ? "In progress" : match.Context != null ? "Complete" : "Waiting" ), false, false );
+ AddHtml( 25, 53, 250, 20, $"Winner: {(match.Winner == null ? "N/A" : match.Winner.NameList)}", false, false );
+ AddHtml( 25, 73, 250, 20,
+ $"State: {(match.InProgress ? "In progress" : match.Context != null ? "Complete" : "Waiting")}", false, false );
AddHtml( 25, 93, 250, 20, "Participants:", false, false );
if ( m_Tournament.TournyType == TournyType.Standard )
@@ -3312,9 +3332,11 @@ namespace Server.Engines.ConPVP
TournyParticipant part = (TournyParticipant)match.Participants[i];
if ( m_Tournament.EventController != null )
- AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", m_Tournament.EventController.GetTeamName( i ), part.Players.Count ) );
+ AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
+ $"Team {m_Tournament.EventController.GetTeamName(i)} ({part.Players.Count})");
else if ( m_Tournament.TournyType == TournyType.RandomTeam )
- AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i+1, part.Players.Count ) );
+ AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
+ $"Team {i + 1} ({part.Players.Count})");
else if ( m_Tournament.TournyType == TournyType.Faction ) {
if ( m_Tournament.ParticipantsPerMatch == 4 )
{
@@ -3340,19 +3362,23 @@ namespace Server.Engines.ConPVP
}
}
- AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "{0} ({1})", name, part.Players.Count ) );
+ AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
+ $"{name} ({part.Players.Count})");
}
else if ( m_Tournament.ParticipantsPerMatch == 2 )
{
- AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "{0} Team ({1})", i==0?"Evil":"Hero", part.Players.Count ) );
+ AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
+ $"{(i == 0 ? "Evil" : "Hero")} Team ({part.Players.Count})");
}
else
{
- AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i+1, part.Players.Count ) );
+ AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
+ $"Team {i + 1} ({part.Players.Count})");
}
}
else
- AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i==0?"Red":"Blue", part.Players.Count ) );
+ AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
+ $"Team {(i == 0 ? "Red" : "Blue")} ({part.Players.Count})");
}
}
else if ( m_Tournament.TournyType == TournyType.FreeForAll )
diff --git a/Scripts/Engines/ConPVP/Trophy.cs b/Scripts/Engines/ConPVP/Trophy.cs
index 37c2b3a8d..49c2b1ff6 100644
--- a/Scripts/Engines/ConPVP/Trophy.cs
+++ b/Scripts/Engines/ConPVP/Trophy.cs
@@ -100,7 +100,7 @@ namespace Server.Items
public void UpdateStyle()
{
- Name = String.Format( "{0} trophy", m_Rank.ToString().ToLower() );
+ Name = $"{m_Rank.ToString().ToLower()} trophy";
switch ( m_Rank )
{
diff --git a/Scripts/Engines/Craft/Core/CraftGump.cs b/Scripts/Engines/Craft/Core/CraftGump.cs
index 6548f1518..cd357dfd9 100644
--- a/Scripts/Engines/Craft/Core/CraftGump.cs
+++ b/Scripts/Engines/Craft/Core/CraftGump.cs
@@ -106,7 +106,7 @@ namespace Server.Engines.Craft
if ( notice is int noticeInt && noticeInt > 0 )
AddHtmlLocalized( 170, 295, 350, 40, noticeInt, LabelColor, false, false );
else if ( notice is string )
- AddHtml( 170, 295, 350, 40, String.Format( "{1}", FontColor, notice ), false, false );
+ AddHtml( 170, 295, 350, 40, $"{notice}", false, false );
// If the system has more than one resource
if ( craftSystem.CraftSubRes.Init )
@@ -142,7 +142,7 @@ namespace Server.Engines.Craft
if ( nameNumber > 0 )
AddHtmlLocalized( 50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
else
- AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
+ AddLabel( 50, 362, LabelHue, $"{nameString} ({resourceCount} Available)");
}
// ****************************************
@@ -180,7 +180,7 @@ namespace Server.Engines.Craft
if ( nameNumber > 0 )
AddHtmlLocalized( 50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
else
- AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
+ AddLabel( 50, 385, LabelHue, $"{nameString} ({resourceCount} Available)");
}
// ****************************************
@@ -235,7 +235,7 @@ namespace Server.Engines.Craft
if ( subResource.NameNumber > 0 )
AddHtmlLocalized( 255, 63 + (index * 20), 250, 18, subResource.NameNumber, resourceCount.ToString(), LabelColor, false, false );
else
- AddLabel( 255, 60 + ( index * 20 ), LabelHue, String.Format( "{0} ({1})", subResource.NameString, resourceCount ) );
+ AddLabel( 255, 60 + ( index * 20 ), LabelHue, $"{subResource.NameString} ({resourceCount})");
}
}
diff --git a/Scripts/Engines/Craft/Core/CraftGumpItem.cs b/Scripts/Engines/Craft/Core/CraftGumpItem.cs
index 806c9512d..0883cf13a 100644
--- a/Scripts/Engines/Craft/Core/CraftGumpItem.cs
+++ b/Scripts/Engines/Craft/Core/CraftGumpItem.cs
@@ -112,7 +112,7 @@ namespace Server.Engines.Craft
case Expansion.ML:
return 1072651; // * Requires the "Mondain's Legacy" expansion
default:
- return String.Format( "* Requires the \"{0}\" expansion", ExpansionInfo.GetInfo( expansion ).Name );
+ return $"* Requires the \"{ExpansionInfo.GetInfo(expansion).Name}\" expansion";
}
}
@@ -142,7 +142,7 @@ namespace Server.Engines.Craft
minSkill = 0;
AddHtmlLocalized( 170, 132 + (i * 20), 200, 18, AosSkillBonuses.GetLabel( skill.SkillToMake ), LabelColor, false, false );
- AddLabel( 430, 132 + (i * 20), LabelHue, String.Format( "{0:F1}", minSkill ) );
+ AddLabel( 430, 132 + (i * 20), LabelHue, $"{minSkill:F1}");
}
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
@@ -163,7 +163,7 @@ namespace Server.Engines.Craft
chance = 1.0;
AddHtmlLocalized( 170, 80, 250, 18, 1044057, LabelColor, false, false ); // Success Chance:
- AddLabel( 430, 80, LabelHue, String.Format( "{0:F1}%", chance * 100 ) );
+ AddLabel( 430, 80, LabelHue, $"{chance * 100:F1}%");
if ( m_ShowExceptionalChance )
{
@@ -173,7 +173,7 @@ namespace Server.Engines.Craft
excepChance = 1.0;
AddHtmlLocalized( 170, 100, 250, 18, 1044058, 32767, false, false ); // Exceptional Chance:
- AddLabel( 430, 100, LabelHue, String.Format( "{0:F1}%", excepChance * 100 ) );
+ AddLabel( 430, 100, LabelHue, $"{excepChance * 100:F1}%");
}
}
diff --git a/Scripts/Engines/Craft/Core/CraftItem.cs b/Scripts/Engines/Craft/Core/CraftItem.cs
index 750708235..558ffddac 100644
--- a/Scripts/Engines/Craft/Core/CraftItem.cs
+++ b/Scripts/Engines/Craft/Core/CraftItem.cs
@@ -1016,7 +1016,8 @@ namespace Server.Engines.Craft
case Expansion.ML:
return 1072650; // The "Mondain's Legacy" expansion is required to attempt this item.
default:
- return String.Format( "The \"{0}\" expansion is required to attempt this item.", ExpansionInfo.GetInfo( expansion ).Name );
+ return
+ $"The \"{ExpansionInfo.GetInfo(expansion).Name}\" expansion is required to attempt this item.";
}
}
diff --git a/Scripts/Engines/Factions/Core/Faction.cs b/Scripts/Engines/Factions/Core/Faction.cs
index 04d858577..56ae5f03b 100644
--- a/Scripts/Engines/Factions/Core/Faction.cs
+++ b/Scripts/Engines/Factions/Core/Faction.cs
@@ -1141,7 +1141,7 @@ namespace Server.Factions
silver = killerState.Faction.AwardSilver( killer, award * 40 );
if ( silver > 0 )
- killer.SendLocalizedMessage( 1042736, String.Format( "{0:N0} silver\t{1}", silver, victim.Name ) ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
+ killer.SendLocalizedMessage( 1042736, $"{silver:N0} silver\t{victim.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
}
victimState.KillPoints -= award;
@@ -1149,7 +1149,7 @@ namespace Server.Factions
int offset = ( award != 1 ? 0 : 2 ); // for pluralization
- string args = String.Format( "{0}\t{1}\t{2}", award, victim.Name, killer.Name );
+ string args = $"{award}\t{victim.Name}\t{killer.Name}";
killer.SendLocalizedMessage( 1042737 + offset, args ); // Thou hast been honored with ~1_KILL_POINTS~ kill point(s) for vanquishing ~2_DEAD_PLAYER~!
victim.SendLocalizedMessage( 1042738 + offset, args ); // Thou has lost ~1_KILL_POINTS~ kill point(s) to ~3_ATTACKER_NAME~ for being vanquished!
diff --git a/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs b/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs
index 2377c711a..1eb6e5d79 100644
--- a/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs
+++ b/Scripts/Engines/Factions/Gumps/ElectionManagementGump.cs
@@ -8,22 +8,22 @@ namespace Server.Factions
{
public string Right( string text )
{
- return String.Format( "{0}
", text );
+ return $"{text}
";
}
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
public static string FormatTimeSpan( TimeSpan ts )
{
- return String.Format( "{0:D2}:{1:D2}:{2:D2}:{3:D2}", ts.Days, ts.Hours % 24, ts.Minutes % 60, ts.Seconds % 60 );
+ return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
}
public const int LabelColor = 0xFFFFFF;
diff --git a/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs b/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs
index 36caa9def..8b0d5275e 100644
--- a/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs
+++ b/Scripts/Engines/Factions/Items/Traps/BaseFactionTrap.cs
@@ -93,7 +93,7 @@ namespace Server.Factions
if ( from.Alive )
m_Placer.SendMessage( "You have earned {0} silver pieces because {1} fell for your trap.", silverGiven, from.Name );
else
- m_Placer.SendLocalizedMessage( 1042736, String.Format( "{0} silver\t{1}", silverGiven, from.Name ) ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
+ m_Placer.SendLocalizedMessage( 1042736, $"{silverGiven} silver\t{@from.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
}
victimState.OnGivenSilverTo( m_Placer );
diff --git a/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs b/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs
index 134e11b84..ad41b1861 100644
--- a/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs
+++ b/Scripts/Engines/Factions/Mobiles/Guards/GuardAI.cs
@@ -215,7 +215,7 @@ namespace Server.Factions
public int GetStatMod( Mobile mob, StatType type )
{
- StatMod mod = mob.GetStatMod( String.Format( "[Magic] {0} Offset", type ) );
+ StatMod mod = mob.GetStatMod($"[Magic] {type} Offset");
if ( mod == null )
return 0;
diff --git a/Scripts/Engines/Help/PageQueueGump.cs b/Scripts/Engines/Help/PageQueueGump.cs
index c788134de..8d4924d65 100644
--- a/Scripts/Engines/Help/PageQueueGump.cs
+++ b/Scripts/Engines/Help/PageQueueGump.cs
@@ -92,7 +92,8 @@ namespace Server.Engines.Help
string typeString = PageQueue.GetPageTypeName( e.Type );
- string html = String.Format( "[{0}] {1} [{3}]", typeString, e.Message, e.Handler == null ? 0xFF0000 : 0xFF, e.Handler == null ? "Unhandled" : "Handling" );
+ string html =
+ $"[{typeString}] {e.Message} [{(e.Handler == null ? "Unhandled" : "Handling")}]";
Add( new GumpHtml( 12, 44 + ((i % 5) * 80), 350, 70, html, true, true ) );
Add( new GumpButton( 370, 44 + ((i % 5) * 80) + 24, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0 ) );
@@ -242,12 +243,12 @@ namespace Server.Engines.Help
public string Center( string text )
{
- return String.Format( "{0}", text );
+ return $"{text}";
}
public string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
public void AddTextInput( int x, int y, int w, int h, int id, string def )
@@ -297,7 +298,7 @@ namespace Server.Engines.Help
PredefinedResponse resp = (PredefinedResponse)list[i];
- string html = String.Format( "{0}
{1}", resp.Title, resp.Message );
+ string html = $"{resp.Title}
{resp.Message}";
AddHtml( 12, 44 + ((i % 5) * 80), 350, 70, html, true, true );
@@ -501,7 +502,8 @@ namespace Server.Engines.Help
AddLabelCropped( 128, 18, 264, 20, 2100, entry.Sent.ToString() );
AddLabel( 18, 38, 2100, "Sender:" );
- AddLabelCropped( 128, 38, 264, 20, 2100, String.Format( "{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map ) );
+ AddLabelCropped( 128, 38, 264, 20, 2100,
+ $"{entry.Sender.RawName} {entry.Sender.Location} [{entry.Sender.Map}]");
AddButton( 18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0 );
AddImageTiled( 52, bottom - (buttons * 22) + 1, 340, 80, 0xA40/*0xBBC*//*0x2458*/ );
@@ -549,7 +551,7 @@ namespace Server.Engines.Help
}
AddLabel( 18, 78, 2100, "Page Location:" );
- AddLabelCropped( 128, 78, 264, 20, 2100, String.Format( "{0} [{1}]", entry.PageLocation, entry.PageMap ) );
+ AddLabelCropped( 128, 78, 264, 20, 2100, $"{entry.PageLocation} [{entry.PageMap}]");
AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 );
AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Page Location" );
diff --git a/Scripts/Engines/Help/PageResponseGump.cs b/Scripts/Engines/Help/PageResponseGump.cs
index 1f16d941f..117d5f1a1 100644
--- a/Scripts/Engines/Help/PageResponseGump.cs
+++ b/Scripts/Engines/Help/PageResponseGump.cs
@@ -21,7 +21,7 @@ namespace Server.Engines.Help
AddHtmlLocalized( 150, 40, 360, 40, 1062610, false, false ); // Ultima Online Help Response
- AddHtml( 80, 90, 480, 290, String.Format( "{0} tells {1}: {2}", name, from.Name, text ), true, true );
+ AddHtml( 80, 90, 480, 290, $"{name} tells {@from.Name}: {text}", true, true );
AddHtmlLocalized( 80, 390, 480, 40, 1062611, false, false ); // Clicking the OKAY button will remove the reponse you have received.
AddButton( 400, 417, 2074, 2075, 1, GumpButtonType.Reply, 0 ); // OKAY
diff --git a/Scripts/Engines/Help/SpeechLogGump.cs b/Scripts/Engines/Help/SpeechLogGump.cs
index 72871e80b..4d7032168 100644
--- a/Scripts/Engines/Help/SpeechLogGump.cs
+++ b/Scripts/Engines/Help/SpeechLogGump.cs
@@ -37,7 +37,8 @@ namespace Server.Engines.Help
string playerName = player.Name;
string playerAccount = player.Account is Account ? player.Account.Username : "???";
- AddHtml( 10, 10, 280, 20, String.Format( "SPEECH LOG - {0} ({1})", playerName, Utility.FixHtml( playerAccount ) ), false, false );
+ AddHtml( 10, 10, 280, 20,
+ $"SPEECH LOG - {playerName} ({Utility.FixHtml(playerAccount)})", false, false );
int lastPage = ( log.Count - 1 ) / MaxEntriesPerPage;
@@ -78,7 +79,7 @@ namespace Server.Engines.Help
if ( page > 0 )
AddButton( 10, 395, 0xFAE, 0xFB0, 1, GumpButtonType.Reply, 0 ); // Previous page
- AddLabel( 45, 395, 0x481, String.Format( "Current page: {0}/{1}", page + 1, lastPage + 1 ) );
+ AddLabel( 45, 395, 0x481, $"Current page: {page + 1}/{lastPage + 1}");
if ( page < lastPage )
AddButton( 261, 395, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 ); // Next page
diff --git a/Scripts/Engines/Khaldun/KhaldunGen.cs b/Scripts/Engines/Khaldun/KhaldunGen.cs
index cab1c72aa..3a89bd2f0 100644
--- a/Scripts/Engines/Khaldun/KhaldunGen.cs
+++ b/Scripts/Engines/Khaldun/KhaldunGen.cs
@@ -204,7 +204,7 @@ namespace Server.Commands
sw.RaisableItem = stone;
lv.RaisableItem = door;
- e.Mobile.SendMessage( String.Format( "{0} dynamic Khaldun item{1} generated.", m_Count, m_Count == 1 ? "" : "s" ) );
+ e.Mobile.SendMessage($"{m_Count} dynamic Khaldun item{(m_Count == 1 ? "" : "s")} generated.");
}
}
}
diff --git a/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs b/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs
index ad13d8e6b..a63fad086 100644
--- a/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs
+++ b/Scripts/Engines/MLQuests/Gumps/BaseQuestGump.cs
@@ -164,7 +164,7 @@ namespace Server.Engines.MLQuests.Gumps
public void SetTitle( TextDefinition def )
{
if ( def.Number > 0 )
- m_Title = String.Format( "#{0}", def.Number ); // OSI does "@@#{0}" instead, why? KR client related?
+ m_Title = $"#{def.Number}"; // OSI does "@@#{0}" instead, why? KR client related?
else
m_Title = def.String;
}
diff --git a/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs b/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs
index e3e2dd190..f8861d235 100644
--- a/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs
+++ b/Scripts/Engines/MLQuests/Gumps/RaceChangeGump.cs
@@ -42,7 +42,7 @@ namespace Server.Engines.MLQuests.Gumps
else if ( targetRace == Race.Elf )
AddHtmlLocalized( 15, 15, 210, 75, 1073642, 0, false, false ); // Are you sure you want to follow the elven ways?
else
- AddHtml( 15, 15, 210, 75, String.Format( "Are you sure you want to change your race to {0}?", targetRace.Name ), false, false );
+ AddHtml( 15, 15, 210, 75, $"Are you sure you want to change your race to {targetRace.Name}?", false, false );
AddButton( 160, 95, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0 );
AddButton( 90, 95, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0 );
diff --git a/Scripts/Engines/MLQuests/Items/Teleporters.cs b/Scripts/Engines/MLQuests/Items/Teleporters.cs
index c8d106799..b4d49fac0 100644
--- a/Scripts/Engines/MLQuests/Items/Teleporters.cs
+++ b/Scripts/Engines/MLQuests/Items/Teleporters.cs
@@ -68,7 +68,7 @@ namespace Server.Engines.MLQuests.Items
base.GetProperties(list);
if (m_QuestType != null)
- list.Add(String.Format("Required quest: {0}", m_QuestType.Name));
+ list.Add($"Required quest: {m_QuestType.Name}");
}
public MLQuestTeleporter(Serial serial)
@@ -187,7 +187,7 @@ namespace Server.Engines.MLQuests.Items
base.GetProperties(list);
if (m_TicketType != null)
- list.Add(String.Format("Required ticket: {0}", m_TicketType.Name));
+ list.Add($"Required ticket: {m_TicketType.Name}");
}
public TicketTeleporter(Serial serial)
diff --git a/Scripts/Engines/MLQuests/MLQuest.cs b/Scripts/Engines/MLQuests/MLQuest.cs
index 93631356f..7b011e665 100644
--- a/Scripts/Engines/MLQuests/MLQuest.cs
+++ b/Scripts/Engines/MLQuests/MLQuest.cs
@@ -159,7 +159,7 @@ namespace Server.Engines.MLQuests
public void PutSpawner( Spawner s, Point3D loc, Map map )
{
- string name = String.Format( "MLQS-{0}", GetType().Name );
+ string name = $"MLQS-{GetType().Name}";
// Auto cleanup on regeneration
List- toDelete = new List
- ();
diff --git a/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs b/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs
index df06bea2d..5ba01f591 100644
--- a/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs
+++ b/Scripts/Engines/MLQuests/Mobiles/BoonCollector.cs
@@ -218,7 +218,7 @@ namespace Server.Engines.MLQuests.Mobiles
if ( m_Index == 0 )
{
if ( m_Target.ShowFameTitle && m_Target.Fame >= 10000 )
- m_Owner.Say( true, String.Format( "{0} {1}", m_Target.Female ? "Lady" : "Lord", m_Target.Name ) );
+ m_Owner.Say( true, $"{(m_Target.Female ? "Lady" : "Lord")} {m_Target.Name}");
else
m_Owner.Say( true, m_Target.Name );
}
diff --git a/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs b/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs
index 377f8abd9..569297a3c 100644
--- a/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs
+++ b/Scripts/Engines/MLQuests/Objectives/DeliverObjective.cs
@@ -212,7 +212,7 @@ namespace Server.Engines.MLQuests.Objectives
if ( total < desired )
{
pm.SendLocalizedMessage( 1074861 ); // You do not have everything you need!
- pm.SendLocalizedMessage( 1074885, String.Format( "{0}\t{1}", total, desired ) ); // You have ~1_val~ item(s) but require ~2_val~
+ pm.SendLocalizedMessage( 1074885, $"{total}\t{desired}"); // You have ~1_val~ item(s) but require ~2_val~
return false;
}
diff --git a/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs b/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs
index abac97c8c..5f33afd40 100644
--- a/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs
+++ b/Scripts/Engines/MLQuests/Objectives/GainSkillObjective.cs
@@ -85,9 +85,9 @@ namespace Server.Engines.MLQuests.Objectives
string args;
if ( m_ThresholdFixed % 10 == 0 )
- args = String.Format( "#{0}\t{1}", skillLabel, m_ThresholdFixed / 10 ); // as seen on OSI
+ args = $"#{skillLabel}\t{m_ThresholdFixed / 10}"; // as seen on OSI
else
- args = String.Format( "#{0}\t{1:0.0}", skillLabel, (double)m_ThresholdFixed / 10 ); // for non-integer skill levels
+ args = $"#{skillLabel}\t{(double) m_ThresholdFixed / 10:0.0}"; // for non-integer skill levels
g.AddHtmlLocalized( 98, y, 312, 16, 1077485, args, 0x15F90, false, false ); // Increase ~1_SKILL~ to ~2_VALUE~
y += 16;
diff --git a/Scripts/Engines/MyRunUO/Config.cs b/Scripts/Engines/MyRunUO/Config.cs
index 245663ef8..5f754b8bf 100644
--- a/Scripts/Engines/MyRunUO/Config.cs
+++ b/Scripts/Engines/MyRunUO/Config.cs
@@ -42,8 +42,8 @@ namespace Server.Engines.MyRunUO
public static string CompileConnectionString()
{
- string connectionString = String.Format( "DRIVER={0};SERVER={1};DATABASE={2};UID={3};PASSWORD={4};",
- DatabaseDriver, DatabaseServer, DatabaseName, DatabaseUserID, DatabasePassword );
+ string connectionString =
+ $"DRIVER={DatabaseDriver};SERVER={DatabaseServer};DATABASE={DatabaseName};UID={DatabaseUserID};PASSWORD={DatabasePassword};";
return connectionString;
}
diff --git a/Scripts/Engines/MyRunUO/MyRunUO.cs b/Scripts/Engines/MyRunUO/MyRunUO.cs
index e69c1b4d2..4b3177b1c 100644
--- a/Scripts/Engines/MyRunUO/MyRunUO.cs
+++ b/Scripts/Engines/MyRunUO/MyRunUO.cs
@@ -532,7 +532,7 @@ namespace Server.Engines.MyRunUO
public StreamWriter GetUniqueWriter( string type, out string filePath )
{
- filePath = Path.Combine( Core.BaseDirectory, String.Format( "myrunuodb_{0}.txt", type ) ).Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
+ filePath = Path.Combine( Core.BaseDirectory, $"myrunuodb_{type}.txt").Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
try
{
@@ -544,7 +544,7 @@ namespace Server.Engines.MyRunUO
{
try
{
- filePath = Path.Combine( Core.BaseDirectory, String.Format( "myrunuodb_{0}_{1}.txt", type, i ) ).Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
+ filePath = Path.Combine( Core.BaseDirectory, $"myrunuodb_{type}_{i}.txt").Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
return new StreamWriter( filePath );
}
catch
@@ -639,7 +639,7 @@ namespace Server.Engines.MyRunUO
ExecuteNonQueryIfNull(
String.Format( "SELECT guild_1 FROM myrunuo_guilds_wars WHERE (guild_1={0} AND guild_2={1}) OR (guild_1={1} AND guild_2={0})", ourId, theirId ),
- String.Format( "INSERT INTO myrunuo_guilds_wars (guild_1, guild_2) VALUES ({0}, {1})", ourId, theirId ) );
+ $"INSERT INTO myrunuo_guilds_wars (guild_1, guild_2) VALUES ({ourId}, {theirId})");
}
}
diff --git a/Scripts/Engines/MyRunUO/MyRunUOStatus.cs b/Scripts/Engines/MyRunUO/MyRunUOStatus.cs
index a29cd52ef..e365a5bb0 100644
--- a/Scripts/Engines/MyRunUO/MyRunUOStatus.cs
+++ b/Scripts/Engines/MyRunUO/MyRunUOStatus.cs
@@ -56,7 +56,8 @@ namespace Server.Engines.MyRunUO
Mobile mob = ns.Mobile;
if ( mob != null )
- m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status (char_id) VALUES ({0})", mob.Serial.Value.ToString() ) );
+ m_Command.Enqueue(
+ $"INSERT INTO myrunuo_status (char_id) VALUES ({mob.Serial.Value.ToString()})");
}
}
catch ( Exception e )
diff --git a/Scripts/Engines/Party/Party.cs b/Scripts/Engines/Party/Party.cs
index d788059e8..e314fa830 100644
--- a/Scripts/Engines/Party/Party.cs
+++ b/Scripts/Engines/Party/Party.cs
@@ -68,7 +68,7 @@ namespace Server.Engines.PartySystem
else if ( m == null )
p.SendPublicMessage( from, "I was killed !!" );
else
- p.SendPublicMessage( from, String.Format( "I was killed by {0} !!", m.Name ) );
+ p.SendPublicMessage( from, $"I was killed by {m.Name} !!");
}
}
diff --git a/Scripts/Engines/Plants/PlantItem.cs b/Scripts/Engines/Plants/PlantItem.cs
index 0eb1ee87d..c13e79799 100644
--- a/Scripts/Engines/Plants/PlantItem.cs
+++ b/Scripts/Engines/Plants/PlantItem.cs
@@ -258,9 +258,9 @@ namespace Server.Engines.Plants
string args;
if ( ShowContainerType )
- args = String.Format( "#{0}\t#{1}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus() );
+ args = $"#{GetLocalizedContainerType()}\t#{m_PlantSystem.GetLocalizedDirtStatus()}";
else
- args = String.Format( "#{0}", m_PlantSystem.GetLocalizedDirtStatus() );
+ args = $"#{m_PlantSystem.GetLocalizedDirtStatus()}";
list.Add( 1060830, args ); // a ~1_val~ of ~2_val~ dirt
}
@@ -271,24 +271,26 @@ namespace Server.Engines.Plants
if ( m_PlantStatus >= PlantStatus.DecorativePlant )
{
- list.Add( typeInfo.GetPlantLabelDecorative( hueInfo ), String.Format( "#{0}\t#{1}", hueInfo.Name, typeInfo.Name ) );
+ list.Add( typeInfo.GetPlantLabelDecorative( hueInfo ), $"#{hueInfo.Name}\t#{typeInfo.Name}");
}
else if ( m_PlantStatus >= PlantStatus.FullGrownPlant )
{
- list.Add( typeInfo.GetPlantLabelFullGrown( hueInfo ), String.Format( "#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedHealth(), hueInfo.Name, typeInfo.Name ) );
+ list.Add( typeInfo.GetPlantLabelFullGrown( hueInfo ),
+ $"#{m_PlantSystem.GetLocalizedHealth()}\t#{hueInfo.Name}\t#{typeInfo.Name}");
}
else
{
string args;
if ( ShowContainerType )
- args = String.Format( "#{0}\t#{1}\t#{2}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth() );
+ args =
+ $"#{GetLocalizedContainerType()}\t#{m_PlantSystem.GetLocalizedDirtStatus()}\t#{m_PlantSystem.GetLocalizedHealth()}";
else
- args = String.Format( "#{0}\t#{1}", m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth() );
+ args = $"#{m_PlantSystem.GetLocalizedDirtStatus()}\t#{m_PlantSystem.GetLocalizedHealth()}";
if ( m_ShowType )
{
- args += String.Format( "\t#{0}\t#{1}\t#{2}", hueInfo.Name, typeInfo.Name, GetLocalizedPlantStatus() );
+ args += $"\t#{hueInfo.Name}\t#{typeInfo.Name}\t#{GetLocalizedPlantStatus()}";
if ( m_PlantStatus == PlantStatus.Plant )
list.Add( typeInfo.GetPlantLabelPlant( hueInfo ), args );
@@ -297,7 +299,8 @@ namespace Server.Engines.Plants
}
else
{
- args += String.Format( "\t#{0}\t#{1}", ( typeInfo.PlantCategory == PlantCategory.Default ) ? hueInfo.Name : (int)typeInfo.PlantCategory, GetLocalizedPlantStatus() );
+ args +=
+ $"\t#{((typeInfo.PlantCategory == PlantCategory.Default) ? hueInfo.Name : (int) typeInfo.PlantCategory)}\t#{GetLocalizedPlantStatus()}";
list.Add( hueInfo.IsBright() ? 1060832 : 1060831, args ); // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
}
diff --git a/Scripts/Engines/Plants/ReproductionGump.cs b/Scripts/Engines/Plants/ReproductionGump.cs
index fec587041..897ceb3f7 100644
--- a/Scripts/Engines/Plants/ReproductionGump.cs
+++ b/Scripts/Engines/Plants/ReproductionGump.cs
@@ -90,7 +90,7 @@ namespace Server.Engines.Plants
else
{
AddLabel( x, y, PlantHueInfo.GetInfo( m_Plant.PlantHue ).GumpHue,
- string.Format( "{0}/{1}", system.AvailableResources, totalResources ) );
+ $"{system.AvailableResources}/{totalResources}");
}
}
@@ -106,7 +106,7 @@ namespace Server.Engines.Plants
else
{
AddLabel( x, y, PlantHueInfo.GetInfo( system.SeedHue ).GumpHue,
- string.Format( "{0}/{1}", system.AvailableSeeds, totalSeeds ) );
+ $"{system.AvailableSeeds}/{totalSeeds}");
}
}
diff --git a/Scripts/Engines/Plants/Seed.cs b/Scripts/Engines/Plants/Seed.cs
index 3e9fb1e63..86d8e36e9 100644
--- a/Scripts/Engines/Plants/Seed.cs
+++ b/Scripts/Engines/Plants/Seed.cs
@@ -106,12 +106,12 @@ namespace Server.Engines.Plants
{
if ( m_ShowType )
{
- args = String.Format( "#{0}\t#{1}", title, typeInfo.Name );
+ args = $"#{title}\t#{typeInfo.Name}";
return typeInfo.GetSeedLabel( hueInfo );
}
else
{
- args = String.Format( "#{0}", title );
+ args = $"#{title}";
return hueInfo.IsBright() ? 1060839 : 1060838; // [bright] ~1_val~ seed
}
}
@@ -119,12 +119,12 @@ namespace Server.Engines.Plants
{
if ( m_ShowType )
{
- args = String.Format( "{0}\t#{1}\t#{2}", Amount, title, typeInfo.Name );
+ args = $"{Amount}\t#{title}\t#{typeInfo.Name}";
return typeInfo.GetSeedLabelPlural( hueInfo );
}
else
{
- args = String.Format( "{0}\t#{1}", Amount, title );
+ args = $"{Amount}\t#{title}";
return hueInfo.IsBright() ? 1113491 : 1113490; // ~1_amount~ [bright] ~2_val~ seeds
}
}
diff --git a/Scripts/Engines/Quests/Core/QuestSystem.cs b/Scripts/Engines/Quests/Core/QuestSystem.cs
index ba663d7cd..80e8a1f84 100644
--- a/Scripts/Engines/Quests/Core/QuestSystem.cs
+++ b/Scripts/Engines/Quests/Core/QuestSystem.cs
@@ -647,7 +647,7 @@ namespace Server.Engines.Quests
public static string Color( string text, int color )
{
- return String.Format( "{1}", color, text );
+ return $"{text}";
}
public static ArrayList BuildList( object obj )
diff --git a/Scripts/Engines/RemoteAdmin/Network.cs b/Scripts/Engines/RemoteAdmin/Network.cs
index 44dcd259d..d08e8b6e0 100644
--- a/Scripts/Engines/RemoteAdmin/Network.cs
+++ b/Scripts/Engines/RemoteAdmin/Network.cs
@@ -31,7 +31,7 @@ namespace Server.RemoteAdmin
string outStr;
if ( m_NewLine )
{
- outStr = String.Format( "[{0}]: {1}", DateTime.UtcNow.ToString( DateFormat ), str );
+ outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {str}";
m_NewLine = false;
}
else
@@ -50,7 +50,7 @@ namespace Server.RemoteAdmin
if ( m_NewLine )
{
string outStr;
- outStr = String.Format( "[{0}]: {1}", DateTime.UtcNow.ToString( DateFormat ), ch );
+ outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {ch}";
m_ConsoleData.Append( outStr );
SendToAll( outStr );
@@ -70,9 +70,9 @@ namespace Server.RemoteAdmin
{
string outStr;
if ( m_NewLine )
- outStr = String.Format( "[{0}]: {1}{2}", DateTime.UtcNow.ToString( DateFormat ), line, Console.Out.NewLine );
+ outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {line}{Console.Out.NewLine}";
else
- outStr = String.Format( "{0}{1}", line, Console.Out.NewLine );
+ outStr = $"{line}{Console.Out.NewLine}";
m_ConsoleData.Append( outStr );
RoughTrimConsoleData();
@@ -126,7 +126,8 @@ namespace Server.RemoteAdmin
}
else if ( cmd == 0xFF )
{
- string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K, Ver={6}", Misc.ServerList.ServerName, (int)(DateTime.UtcNow - Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(GC.GetTotalMemory( false ) / 1024), ProtocolVersion );
+ string statStr =
+ $", Name={Misc.ServerList.ServerName}, Age={(int) (DateTime.UtcNow - Items.Clock.ServerStart).TotalHours}, Clients={NetState.Instances.Count}, Items={World.Items.Count}, Chars={World.Mobiles.Count}, Mem={(int) (GC.GetTotalMemory(false) / 1024)}K, Ver={ProtocolVersion}";
state.Send( new UOGInfo( statStr ) );
state.Dispose();
}
diff --git a/Scripts/Engines/RemoteAdmin/PacketHandlers.cs b/Scripts/Engines/RemoteAdmin/PacketHandlers.cs
index 981b54e8a..728a1e2b6 100644
--- a/Scripts/Engines/RemoteAdmin/PacketHandlers.cs
+++ b/Scripts/Engines/RemoteAdmin/PacketHandlers.cs
@@ -225,7 +225,8 @@ namespace Server.RemoteAdmin
{
string changes = string.Empty;
if ( UpdatedPass ) changes += " Password Changed.";
- if ( oldAcessLevel != a.AccessLevel ) changes = string.Format( "{0} Access level changed from {1} to {2}.", changes, oldAcessLevel, a.AccessLevel );
+ if ( oldAcessLevel != a.AccessLevel ) changes =
+ $"{changes} Access level changed from {oldAcessLevel} to {a.AccessLevel}.";
if ( oldbanned != a.Banned ) changes += a.Banned ? " Banned." : " Unbanned.";
RemoteAdminLogging.WriteLine( state, "Updated account {0}:{1}", a.Username, changes );
}
diff --git a/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs b/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs
index d1dda5f58..6934d98d3 100644
--- a/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs
+++ b/Scripts/Engines/RemoteAdmin/RemoteAdminLogging.cs
@@ -89,7 +89,7 @@ namespace Server.RemoteAdmin
Commands.CommandLogging.AppendPath( ref path, LogBaseDirectory );
Commands.CommandLogging.AppendPath( ref path, LogSubDirectory );
Commands.CommandLogging.AppendPath( ref path, accesslevel );
- path = Path.Combine( path, String.Format( "{0}.log", name ) );
+ path = Path.Combine( path, $"{name}.log");
using ( StreamWriter sw = new StreamWriter( path, true ) )
sw.WriteLine( "{0}: {1}: {2}", DateTime.UtcNow, statestr, text );
diff --git a/Scripts/Engines/Reports/Rendering/HtmlRenderer.cs b/Scripts/Engines/Reports/Rendering/HtmlRenderer.cs
index 643474ddc..adc615d64 100644
--- a/Scripts/Engines/Reports/Rendering/HtmlRenderer.cs
+++ b/Scripts/Engines/Reports/Rendering/HtmlRenderer.cs
@@ -105,7 +105,7 @@ namespace Server.Engines.Reports
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "ftp";
- psi.Arguments = String.Format( "-i -s:\"{0}\"", filePath );
+ psi.Arguments = $"-i -s:\"{filePath}\"";
psi.CreateNoWindow = true;
psi.WindowStyle = ProcessWindowStyle.Hidden;
@@ -298,7 +298,8 @@ namespace Server.Engines.Reports
html.Write( "