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

@ -7,14 +7,13 @@ namespace Server.Targets
public class AIControlMobileTarget : Target
{
private List<BaseAI> m_List;
private OrderType m_Order;
public OrderType Order => m_Order;
public OrderType Order { get; }
public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, ( order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None ) )
{
m_List = new List<BaseAI>();
m_Order = order;
Order = order;
AddAI( ai );
}
@ -30,7 +29,7 @@ namespace Server.Targets
if ( o is Mobile m )
{
for ( int i = 0; i < m_List.Count; ++i )
m_List[i].EndPickTarget( from, m, m_Order );
m_List[i].EndPickTarget( from, m, Order );
}
}
}

View file

@ -1982,17 +1982,11 @@ namespace Server.Mobiles
return delay;
}
private long m_NextMove;
public long NextMove
{
get => m_NextMove;
set => m_NextMove = value;
}
public long NextMove { get; set; }
public virtual bool CheckMove()
{
return (Core.TickCount - m_NextMove >= 0);
return (Core.TickCount - NextMove >= 0);
}
public virtual bool DoMove(Direction d)
@ -2021,10 +2015,10 @@ namespace Server.Mobiles
int delay = (int)(TransformMoveDelay(m_Mobile.CurrentSpeed) * 1000);
m_NextMove += delay;
NextMove += delay;
if (Core.TickCount - m_NextMove > 0)
m_NextMove = Core.TickCount;
if (Core.TickCount - NextMove > 0)
NextMove = Core.TickCount;
m_Mobile.Pushing = false;

View file

@ -43,90 +43,84 @@ namespace Server
return -1;
}
private static OppositionGroup m_TerathansAndOphidians = new OppositionGroup( new[]
public static OppositionGroup TerathansAndOphidians { get; } = new OppositionGroup( new[]
{
new[]
{
typeof( TerathanAvenger ),
typeof( TerathanDrone ),
typeof( TerathanMatriarch ),
typeof( TerathanWarrior )
},
new[]
{
typeof( OphidianArchmage ),
typeof( OphidianKnight ),
typeof( OphidianMage ),
typeof( OphidianMatriarch ),
typeof( OphidianWarrior )
}
} );
new[]
{
typeof( TerathanAvenger ),
typeof( TerathanDrone ),
typeof( TerathanMatriarch ),
typeof( TerathanWarrior )
},
new[]
{
typeof( OphidianArchmage ),
typeof( OphidianKnight ),
typeof( OphidianMage ),
typeof( OphidianMatriarch ),
typeof( OphidianWarrior )
}
} );
public static OppositionGroup TerathansAndOphidians => m_TerathansAndOphidians;
private static OppositionGroup m_SavagesAndOrcs = new OppositionGroup( new[]
public static OppositionGroup SavagesAndOrcs { get; } = new OppositionGroup( new[]
{
new[]
{
typeof( Orc ),
typeof( OrcBomber ),
typeof( OrcBrute ),
typeof( OrcCaptain ),
typeof( OrcishLord ),
typeof( OrcishMage ),
typeof( SpawnedOrcishLord )
},
new[]
{
typeof( Savage ),
typeof( SavageRider ),
typeof( SavageRidgeback ),
typeof( SavageShaman )
}
} );
new[]
{
typeof( Orc ),
typeof( OrcBomber ),
typeof( OrcBrute ),
typeof( OrcCaptain ),
typeof( OrcishLord ),
typeof( OrcishMage ),
typeof( SpawnedOrcishLord )
},
new[]
{
typeof( Savage ),
typeof( SavageRider ),
typeof( SavageRidgeback ),
typeof( SavageShaman )
}
} );
public static OppositionGroup SavagesAndOrcs => m_SavagesAndOrcs;
private static OppositionGroup m_FeyAndUndead = new OppositionGroup( new[]
public static OppositionGroup FeyAndUndead { get; } = new OppositionGroup( new[]
{
new[]
{
typeof( Centaur ),
typeof( EtherealWarrior ),
typeof( Kirin ),
typeof( LordOaks ),
typeof( Pixie ),
typeof( Silvani ),
typeof( Unicorn ),
typeof( Wisp ),
typeof( Treefellow ),
typeof( MLDryad ),
typeof( Satyr )
},
new[]
{
typeof( AncientLich ),
typeof( Bogle ),
typeof( LichLord ),
typeof( Shade ),
typeof( Spectre ),
typeof( Wraith ),
typeof( BoneKnight ),
typeof( Ghoul ),
typeof( Mummy ),
typeof( SkeletalKnight ),
typeof( Skeleton ),
typeof( Zombie ),
typeof( ShadowKnight ),
typeof( DarknightCreeper ),
typeof( RevenantLion ),
typeof( LadyOfTheSnow ),
typeof( RottingCorpse ),
typeof( SkeletalDragon ),
typeof( Lich )
}
} );
public static OppositionGroup FeyAndUndead => m_FeyAndUndead;
new[]
{
typeof( Centaur ),
typeof( EtherealWarrior ),
typeof( Kirin ),
typeof( LordOaks ),
typeof( Pixie ),
typeof( Silvani ),
typeof( Unicorn ),
typeof( Wisp ),
typeof( Treefellow ),
typeof( MLDryad ),
typeof( Satyr )
},
new[]
{
typeof( AncientLich ),
typeof( Bogle ),
typeof( LichLord ),
typeof( Shade ),
typeof( Spectre ),
typeof( Wraith ),
typeof( BoneKnight ),
typeof( Ghoul ),
typeof( Mummy ),
typeof( SkeletalKnight ),
typeof( Skeleton ),
typeof( Zombie ),
typeof( ShadowKnight ),
typeof( DarknightCreeper ),
typeof( RevenantLion ),
typeof( LadyOfTheSnow ),
typeof( RottingCorpse ),
typeof( SkeletalDragon ),
typeof( Lich )
}
} );
}
}

View file

@ -10,33 +10,17 @@ namespace Server
// Should we use the new method of speeds?
private static bool Enabled = true;
private double m_ActiveSpeed;
private double m_PassiveSpeed;
private Type[] m_Types;
public double ActiveSpeed { get; set; }
public double ActiveSpeed
{
get => m_ActiveSpeed;
set => m_ActiveSpeed = value;
}
public double PassiveSpeed { get; set; }
public double PassiveSpeed
{
get => m_PassiveSpeed;
set => m_PassiveSpeed = value;
}
public Type[] Types
{
get => m_Types;
set => m_Types = value;
}
public Type[] Types { get; set; }
public SpeedInfo( double activeSpeed, double passiveSpeed, Type[] types )
{
m_ActiveSpeed = activeSpeed;
m_PassiveSpeed = passiveSpeed;
m_Types = types;
ActiveSpeed = activeSpeed;
PassiveSpeed = passiveSpeed;
Types = types;
}
public static bool Contains( object obj )