Fixes implicit ternary expressions

This commit is contained in:
Kamron Batman 2018-09-14 14:56:48 -07:00
parent c85b0a740c
commit ff26dfa375
345 changed files with 1905 additions and 2336 deletions

View file

@ -188,18 +188,16 @@ namespace Server.Items
"This deed functions as a recall rune marked for the location of the plot it represents." +
"</bodytextblack>";
}
else
{
int daysLeft = (int)Math.Ceiling( ( deed.Stone.Started + deed.Stone.Duration + HouseRaffleStone.ExpirationTime - DateTime.UtcNow ).TotalDays );
return "<bodytextblack>" + "This deed entitles the bearer to build a house on the plot of land " +
$"located at {HouseRaffleStone.FormatLocation(deed.PlotLocation, deed.PlotFacet, false)} on the {deed.PlotFacet} facet.<br><br>" +
$"The deed will expire after {daysLeft} more day{((daysLeft == 1) ? "" : "s")} have passed, and at that time the right to place " +
"a house reverts to normal house construction rules.<br><br>" +
"This deed functions as a recall rune marked for the location of the plot it represents.<br><br>" +
"To place a house on the deeded plot, you must simply have this deed in your backpack " +
"or bank box when using a House Placement Tool there." + "</bodytextblack>";
}
int daysLeft = (int)Math.Ceiling( ( deed.Stone.Started + deed.Stone.Duration + HouseRaffleStone.ExpirationTime - DateTime.UtcNow ).TotalDays );
return "<bodytextblack>" + "This deed entitles the bearer to build a house on the plot of land " +
$"located at {HouseRaffleStone.FormatLocation(deed.PlotLocation, deed.PlotFacet, false)} on the {deed.PlotFacet} facet.<br><br>" +
$"The deed will expire after {daysLeft} more day{((daysLeft == 1) ? "" : "s")} have passed, and at that time the right to place " +
"a house reverts to normal house construction rules.<br><br>" +
"This deed functions as a recall rune marked for the location of the plot it represents.<br><br>" +
"To place a house on the deeded plot, you must simply have this deed in your backpack " +
"or bank box when using a House Placement Tool there." + "</bodytextblack>";
}
}
}

View file

@ -241,17 +241,16 @@ namespace Server.Gumps
if ( xIsNull && yIsNull )
return 0;
else if ( xIsNull )
if ( xIsNull )
return -1;
else if ( yIsNull )
if ( yIsNull )
return 1;
int result = Insensitive.Compare( x.From.Name, y.From.Name );
if ( result == 0 )
return x.Date.CompareTo( y.Date );
else
return result;
return result;
}
}
@ -270,9 +269,9 @@ namespace Server.Gumps
if ( xIsNull && yIsNull )
return 0;
else if ( xIsNull )
if ( xIsNull )
return -1;
else if ( yIsNull )
if ( yIsNull )
return 1;
Account a = x.From.Account as Account;
@ -280,17 +279,16 @@ namespace Server.Gumps
if ( a == null && b == null )
return 0;
else if ( a == null )
if ( a == null )
return -1;
else if ( b == null )
if ( b == null )
return 1;
int result = Insensitive.Compare( a.Username, b.Username );
if ( result == 0 )
return x.Date.CompareTo( y.Date );
else
return result;
return result;
}
}
@ -309,9 +307,9 @@ namespace Server.Gumps
if ( xIsNull && yIsNull )
return 0;
else if ( xIsNull )
if ( xIsNull )
return -1;
else if ( yIsNull )
if ( yIsNull )
return 1;
byte[] a = x.Address.GetAddressBytes();

View file

@ -362,7 +362,7 @@ namespace Server.Items
{
int x = m_Bounds.X + m_Bounds.Width / 2;
int y = m_Bounds.Y + m_Bounds.Height / 2;
int z = ( m_Facet == null ) ? 0 : m_Facet.GetAverageZ( x, y );
int z = m_Facet?.GetAverageZ( x, y ) ?? 0;
return new Point3D( x, y, z );
}
@ -379,8 +379,7 @@ namespace Server.Items
{
if ( m_TicketPrice == 0 )
return "FREE";
else
return $"{m_TicketPrice} gold";
return $"{m_TicketPrice} gold";
}
public override void GetProperties( ObjectPropertyList list )