Changes properties to use automatic property initializers
This commit is contained in:
parent
f0a48ad431
commit
06fa31a7bf
623 changed files with 13072 additions and 19304 deletions
|
|
@ -5,23 +5,12 @@ namespace Server.Mobiles
|
|||
public class Cow : BaseCreature
|
||||
{
|
||||
public override string CorpseName => "a cow corpse";
|
||||
private DateTime m_MilkedOn;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public DateTime MilkedOn
|
||||
{
|
||||
get => m_MilkedOn;
|
||||
set => m_MilkedOn = value;
|
||||
}
|
||||
|
||||
private int m_Milk;
|
||||
public DateTime MilkedOn { get; set; }
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public int Milk
|
||||
{
|
||||
get => m_Milk;
|
||||
set => m_Milk = value;
|
||||
}
|
||||
public int Milk { get; set; }
|
||||
|
||||
public override string DefaultName => "a cow";
|
||||
|
||||
|
|
@ -93,15 +82,15 @@ namespace Server.Mobiles
|
|||
from.SendLocalizedMessage( 1080400 ); // You can not milk the cow from this location.
|
||||
if ( Controlled && ControlMaster != from )
|
||||
from.SendLocalizedMessage( 1071182 ); // The cow nimbly escapes your attempts to milk it.
|
||||
if ( m_Milk == 0 && m_MilkedOn + TimeSpan.FromDays( 1 ) > DateTime.UtcNow )
|
||||
if ( Milk == 0 && MilkedOn + TimeSpan.FromDays( 1 ) > DateTime.UtcNow )
|
||||
from.SendLocalizedMessage( 1080198 ); // This cow can not be milked now. Please wait for some time.
|
||||
else
|
||||
{
|
||||
if ( m_Milk == 0 )
|
||||
m_Milk = 4;
|
||||
if ( Milk == 0 )
|
||||
Milk = 4;
|
||||
|
||||
m_MilkedOn = DateTime.UtcNow;
|
||||
m_Milk--;
|
||||
MilkedOn = DateTime.UtcNow;
|
||||
Milk--;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -119,8 +108,8 @@ namespace Server.Mobiles
|
|||
|
||||
writer.Write( (int) 1 );
|
||||
|
||||
writer.Write( (DateTime) m_MilkedOn );
|
||||
writer.Write( (int) m_Milk );
|
||||
writer.Write( (DateTime) MilkedOn );
|
||||
writer.Write( (int) Milk );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -131,8 +120,8 @@ namespace Server.Mobiles
|
|||
|
||||
if ( version > 0 )
|
||||
{
|
||||
m_MilkedOn = reader.ReadDateTime();
|
||||
m_Milk = reader.ReadInt();
|
||||
MilkedOn = reader.ReadDateTime();
|
||||
Milk = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue