Fixes more casting

This commit is contained in:
Kamron Batman 2018-08-19 11:04:07 +08:00
parent 61937d9c97
commit e77d695684
91 changed files with 512 additions and 908 deletions

View file

@ -67,7 +67,7 @@ namespace Server.Gumps
if ( from.Backpack != null )
totalGold += from.Backpack.GetAmount( typeof( Gold ) );
totalGold += Banker.GetBalance( from );
if ( totalGold < m_VI.Price )
@ -132,9 +132,9 @@ namespace Server.Gumps
double days = (m_Vendor.HoldGold + m_Vendor.BankAccount) / ((double)perDay);
AddHtmlLocalized( 40, 25, 260, 20, 1038318, false, false ); // Amount of days I can work:
AddHtmlLocalized( 40, 25, 260, 20, 1038318, false, false ); // Amount of days I can work:
AddLabel( 300, 25, 0, ((int)days).ToString() );
AddHtmlLocalized( 40, 48, 260, 20, 1038319, false, false ); // Earth days:
AddHtmlLocalized( 40, 48, 260, 20, 1038319, false, false ); // Earth days:
AddLabel( 300, 48, 0, ((int)(days / 12.0)).ToString() );
}
@ -188,30 +188,29 @@ namespace Server.Gumps
{
int goldNeeded = perRealWorldDay - goldHeld;
AddHtmlLocalized( 40, 35, 260, 20, 1038320, 0x7FFF, false, false ); // Gold needed for 1 day of vendor salary:
AddHtmlLocalized( 40, 35, 260, 20, 1038320, 0x7FFF, false, false ); // Gold needed for 1 day of vendor salary:
AddLabel( 300, 35, 0x1F, goldNeeded.ToString() );
}
else
{
int days = goldHeld / perRealWorldDay;
AddHtmlLocalized( 40, 35, 260, 20, 1038318, 0x7FFF, false, false ); // # of days Vendor salary is paid for:
AddHtmlLocalized( 40, 35, 260, 20, 1038318, 0x7FFF, false, false ); // # of days Vendor salary is paid for:
AddLabel( 300, 35, 0x480, days.ToString() );
}
AddHtmlLocalized( 40, 58, 260, 20, 1038324, 0x7FFF, false, false ); // My charge per real world day is:
AddHtmlLocalized( 40, 58, 260, 20, 1038324, 0x7FFF, false, false ); // My charge per real world day is:
AddLabel( 300, 58, 0x480, perRealWorldDay.ToString() );
AddHtmlLocalized( 40, 82, 260, 20, 1038322, 0x7FFF, false, false ); // Gold held in my account:
AddHtmlLocalized( 40, 82, 260, 20, 1038322, 0x7FFF, false, false ); // Gold held in my account:
AddLabel( 300, 82, 0x480, goldHeld.ToString() );
AddHtmlLocalized( 40, 108, 260, 20, 1062509, 0x7FFF, false, false ); // Shop Name:
AddLabel( 140, 106, 0x66D, vendor.ShopName );
if ( vendor is RentedVendor )
if ( vendor is RentedVendor rentedVendor )
{
int days, hours;
((RentedVendor)vendor).ComputeRentalExpireDelay( out days, out hours );
rentedVendor.ComputeRentalExpireDelay( out var days, out var hours );
AddLabel( 38, 132, 0x480, String.Format( "Location rental will expire in {0} day{1} and {2} hour{3}.", days, days != 1 ? "s" : "", hours, hours != 1 ? "s" : "" ) );
}
@ -342,7 +341,7 @@ namespace Server.Gumps
return null;
Item i = null;
try
{
ConstructorInfo ctor = m_Type.GetConstructor( new Type[0] );
@ -352,7 +351,7 @@ namespace Server.Gumps
catch
{
}
return i;
}
@ -544,10 +543,10 @@ namespace Server.Gumps
Mobile from = state.Mobile;
if ( m_Vendor is PlayerVendor && !((PlayerVendor)m_Vendor).CanInteractWith( from, true ) )
if ( m_Vendor is PlayerVendor vendor && !vendor.CanInteractWith( from, true ) )
return;
if ( m_Vendor is PlayerBarkeeper && !((PlayerBarkeeper)m_Vendor).IsOwner( from ) )
if ( m_Vendor is PlayerBarkeeper barkeeper && !barkeeper.IsOwner( from ) )
return;
if ( info.ButtonID == 0 )
@ -738,10 +737,10 @@ namespace Server.Gumps
if ( m_Item.Deleted )
return;
if ( m_Vendor is PlayerVendor && !((PlayerVendor)m_Vendor).CanInteractWith( m_Mob, true ) )
if ( m_Vendor is PlayerVendor vendor && !vendor.CanInteractWith( m_Mob, true ) )
return;
if ( m_Vendor is PlayerBarkeeper && !((PlayerBarkeeper)m_Vendor).IsOwner( m_Mob ) )
if ( m_Vendor is PlayerBarkeeper barkeeper && !barkeeper.IsOwner( m_Mob ) )
return;
m_Item.Hue = hue;
@ -767,10 +766,10 @@ namespace Server.Gumps
if ( m_Vendor.Deleted )
return;
if ( m_Vendor is PlayerVendor && !((PlayerVendor)m_Vendor).CanInteractWith( m_Mob, true ) )
if ( m_Vendor is PlayerVendor vendor && !vendor.CanInteractWith( m_Mob, true ) )
return;
if ( m_Vendor is PlayerBarkeeper && !((PlayerBarkeeper)m_Vendor).IsOwner( m_Mob ) )
if ( m_Vendor is PlayerBarkeeper barkeeper && !barkeeper.IsOwner( m_Mob ) )
return;
if ( m_FacialHair )