Changes properties to use automatic property initializers

This commit is contained in:
Kamron Batman 2018-09-14 15:23:29 -07:00
parent f0a48ad431
commit 06fa31a7bf
623 changed files with 13072 additions and 19304 deletions

View file

@ -15,41 +15,35 @@ namespace Server.Engines.Reports
public override PersistableType TypeID => ThisTypeID;
#endregion
private DateTime m_TimeStamp;
private ObjectCollection m_Children;
public DateTime TimeStamp { get; set; }
public DateTime TimeStamp{ get => m_TimeStamp;
set => m_TimeStamp = value;
}
public ObjectCollection Children{ get => m_Children;
set => m_Children = value;
}
public ObjectCollection Children { get; set; }
public Snapshot()
{
m_Children = new ObjectCollection();
Children = new ObjectCollection();
}
public override void SerializeAttributes( PersistanceWriter op )
{
op.SetDateTime( "t", m_TimeStamp );
op.SetDateTime( "t", TimeStamp );
}
public override void DeserializeAttributes( PersistanceReader ip )
{
m_TimeStamp = ip.GetDateTime( "t" );
TimeStamp = ip.GetDateTime( "t" );
}
public override void SerializeChildren( PersistanceWriter op )
{
for ( int i = 0; i < m_Children.Count; ++i )
m_Children[i].Serialize( op );
for ( int i = 0; i < Children.Count; ++i )
Children[i].Serialize( op );
}
public override void DeserializeChildren( PersistanceReader ip )
{
while ( ip.HasChild )
m_Children.Add( ip.GetChild() );
Children.Add( ip.GetChild() );
}
}
}

View file

@ -15,15 +15,11 @@ namespace Server.Engines.Reports
public override PersistableType TypeID => ThisTypeID;
#endregion
private SnapshotCollection m_Snapshots;
public SnapshotCollection Snapshots{ get => m_Snapshots;
set => m_Snapshots = value;
}
public SnapshotCollection Snapshots { get; set; }
public SnapshotHistory()
{
m_Snapshots = new SnapshotCollection();
Snapshots = new SnapshotCollection();
}
public void Save()
@ -52,14 +48,14 @@ namespace Server.Engines.Reports
public override void SerializeChildren( PersistanceWriter op )
{
for ( int i = 0; i < m_Snapshots.Count; ++i )
m_Snapshots[i].Serialize( op );
for ( int i = 0; i < Snapshots.Count; ++i )
Snapshots[i].Serialize( op );
}
public override void DeserializeChildren( PersistanceReader ip )
{
while ( ip.HasChild )
m_Snapshots.Add( ip.GetChild() as Snapshot );
Snapshots.Add( ip.GetChild() as Snapshot );
}
}
}