Formatting FIxes (#58)

This commit is contained in:
Kamron Batman 2019-10-04 23:08:13 -07:00 • committed by GitHub
parent 57fb9fb525
commit 096d39609e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1318 changed files with 11633 additions and 22129 deletions

View file

@ -216,20 +216,11 @@ namespace Server.Factions
}
}
public bool IsCandidate(Mobile mob)
{
return FindCandidate(mob) != null;
}
public bool IsCandidate(Mobile mob) => FindCandidate(mob) != null;
public bool CanVote(Mobile mob)
{
return CurrentState == ElectionState.Election && !HasVoted(mob);
}
public bool CanVote(Mobile mob) => CurrentState == ElectionState.Election && !HasVoted(mob);
public bool HasVoted(Mobile mob)
{
return FindVoter(mob) != null;
}
public bool HasVoted(Mobile mob) => FindVoter(mob) != null;
public Candidate FindCandidate(Mobile mob)
{

View file

@ -27,10 +27,7 @@ namespace Server.Factions
private FactionDefinition m_Definition;
public int ZeroRankOffset;
public Faction()
{
State = new FactionState(this);
}
public Faction() => State = new FactionState(this);
public StrongholdRegion StrongholdRegion{ get; set; }
@ -88,10 +85,7 @@ namespace Server.Factions
public static List<Faction> Factions => Reflector.Factions;
public int CompareTo(Faction f)
{
return m_Definition.Sort - (f?.m_Definition.Sort ?? 0);
}
public int CompareTo(Faction f) => m_Definition.Sort - (f?.m_Definition.Sort ?? 0);
public void Broadcast(string text)
{
@ -505,10 +499,7 @@ namespace Server.Factions
return mob.AccessLevel >= AccessLevel.GameMaster || mob == Commander;
}
public override string ToString()
{
return m_Definition.FriendlyName;
}
public override string ToString() => m_Definition.FriendlyName;
public static bool CheckLeaveTimer(Mobile mob)
{
@ -1160,10 +1151,7 @@ namespace Server.Factions
{
private Faction m_Faction;
public BroadcastPrompt(Faction faction)
{
m_Faction = faction;
}
public BroadcastPrompt(Faction faction) => m_Faction = faction;
public override void OnResponse(Mobile from, string text)
{
@ -1184,10 +1172,7 @@ namespace Server.Factions
public Timer m_Timer;
}
public static bool InSkillLoss(Mobile mob)
{
return m_SkillLoss.ContainsKey(mob);
}
public static bool InSkillLoss(Mobile mob) => m_SkillLoss.ContainsKey(mob);
public static void ApplySkillLoss(Mobile mob)
{

View file

@ -67,9 +67,6 @@ namespace Server.Factions
}
}
private static bool CheckExistance(Point3D loc, Map facet, Type type)
{
return facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
}
private static bool CheckExistance(Point3D loc, Map facet, Type type) => facet.GetItemsInRange(loc, 0).Any(type.IsInstanceOfType);
}
}

View file

@ -76,10 +76,7 @@ namespace Server.Factions
return false;
}
public static bool IsQualified(Mobile mob, MerchantTitle title)
{
return IsQualified(mob, GetInfo(title));
}
public static bool IsQualified(Mobile mob, MerchantTitle title) => IsQualified(mob, GetInfo(title));
public static bool IsQualified(Mobile mob, MerchantTitleInfo info)
{

View file

@ -14,10 +14,7 @@ namespace Server.Factions
base.Delete();
}
public FactionPersistance(Serial serial) : base(serial)
{
Instance = this;
}
public FactionPersistance(Serial serial) : base(serial) => Instance = this;
public static FactionPersistance Instance{ get; private set; }

View file

@ -241,10 +241,7 @@ namespace Server.Factions
public bool IsActive{ get; set; }
public int CompareTo(PlayerState ps)
{
return (ps?.m_KillPoints ?? 0) - m_KillPoints;
}
public int CompareTo(PlayerState ps) => (ps?.m_KillPoints ?? 0) - m_KillPoints;
public bool CanGiveSilverTo(Mobile mob)
{
@ -295,9 +292,6 @@ namespace Server.Factions
writer.Write(Leaving);
}
public static PlayerState Find(Mobile mob)
{
return mob is PlayerMobile mobile ? mobile.FactionPlayerState : null;
}
public static PlayerState Find(Mobile mob) => mob is PlayerMobile mobile ? mobile.FactionPlayerState : null;
}
}

View file

@ -32,9 +32,6 @@ namespace Server.Factions
return Faction.Find(m, true, true) != null;
}
public override bool AllowHousing(Mobile from, Point3D p)
{
return false;
}
public override bool AllowHousing(Mobile from, Point3D p) => false;
}
}

View file

@ -132,10 +132,7 @@ namespace Server.Factions
public static List<Town> Towns => Reflector.Towns;
public int CompareTo(Town other)
{
return Definition.Sort - (other?.Definition.Sort ?? 0);
}
public int CompareTo(Town other) => Definition.Sort - (other?.Definition.Sort ?? 0);
public static Town FromRegion(Region reg)
{
@ -379,17 +376,13 @@ namespace Server.Factions
CommandSystem.Register("GrantTownSilver", AccessLevel.Administrator, GrantTownSilver_OnCommand);
}
public bool IsSheriff(Mobile mob)
{
return mob?.Deleted == false &&
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff);
}
public bool IsSheriff(Mobile mob) =>
mob?.Deleted == false &&
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Sheriff);
public bool IsFinance(Mobile mob)
{
return mob?.Deleted == false &&
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance);
}
public bool IsFinance(Mobile mob) =>
mob?.Deleted == false &&
(mob.AccessLevel >= AccessLevel.GameMaster || mob == Finance);
public void Capture(Faction f)
{
@ -445,10 +438,7 @@ namespace Server.Factions
ConstructGuardLists();
}
public override string ToString()
{
return Definition.FriendlyName;
}
public override string ToString() => Definition.FriendlyName;
public static void WriteReference(GenericWriter writer, Town town)
{

View file

@ -7,10 +7,7 @@ namespace Server.Factions
private Mobile m_Finance;
private Mobile m_Sheriff;
public TownState(Town town)
{
Town = town;
}
public TownState(Town town) => Town = town;
public TownState(GenericReader reader)
{

View file

@ -138,25 +138,13 @@ namespace Server.Factions
}
}
public string Right(string text)
{
return $"<DIV ALIGN=RIGHT>{text}</DIV>";
}
public string Right(string text) => $"<DIV ALIGN=RIGHT>{text}</DIV>";
public string Center(string text)
{
return $"<CENTER>{text}</CENTER>";
}
public string Center(string text) => $"<CENTER>{text}</CENTER>";
public string Color(string text, int color)
{
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
public string Color(string text, int color) => $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
public static string FormatTimeSpan(TimeSpan ts)
{
return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
}
public static string FormatTimeSpan(TimeSpan ts) => $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
public override void OnResponse(NetState sender, RelayInfo info)
{

View file

@ -10,10 +10,7 @@ namespace Server.Factions
public virtual int ButtonTypes => 10;
public int ToButtonID(int type, int index)
{
return 1 + index * ButtonTypes + type;
}
public int ToButtonID(int type, int index) => 1 + index * ButtonTypes + type;
public bool FromButtonID(int buttonID, out int type, out int index)
{
@ -30,10 +27,7 @@ namespace Server.Factions
return false;
}
public static bool Exists(Mobile mob)
{
return mob.HasGump<FactionGump>();
}
public static bool Exists(Mobile mob) => mob.HasGump<FactionGump>();
public void AddHtmlText(int x, int y, int width, int height, TextDefinition text, bool back, bool scroll)
{

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Britain : Town
{
public Britain()
{
public Britain() =>
Definition =
new TownDefinition(
0,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041386, "Corrupted Faction Town Sigil of Britain"),
new Point3D(1592, 1680, 10),
new Point3D(1588, 1676, 10));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Magincia : Town
{
public Magincia()
{
public Magincia() =>
Definition =
new TownDefinition(
7,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041393, "Corrupted Faction Town Sigil of Magincia"),
new Point3D(3714, 2235, 20),
new Point3D(3712, 2230, 20));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Minoc : Town
{
public Minoc()
{
public Minoc() =>
Definition =
new TownDefinition(
2,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041388, "Corrupted Faction Town Sigil of Minoc"),
new Point3D(2471, 439, 15),
new Point3D(2469, 445, 15));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Moonglow : Town
{
public Moonglow()
{
public Moonglow() =>
Definition =
new TownDefinition(
3,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041389, "Corrupted Faction Town Sigil of Moonglow"),
new Point3D(4436, 1083, 0),
new Point3D(4432, 1086, 0));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class SkaraBrae : Town
{
public SkaraBrae()
{
public SkaraBrae() =>
Definition =
new TownDefinition(
6,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041392, "Corrupted Faction Town Sigil of Skara Brae"),
new Point3D(576, 2200, 0),
new Point3D(572, 2196, 0));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Trinsic : Town
{
public Trinsic()
{
public Trinsic() =>
Definition =
new TownDefinition(
1,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041387, "Corrupted Faction Town Sigil of Trinsic"),
new Point3D(1914, 2717, 20),
new Point3D(1909, 2720, 20));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Vesper : Town
{
public Vesper()
{
public Vesper() =>
Definition =
new TownDefinition(
5,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041391, "Corrupted Faction Town Sigil of Vesper"),
new Point3D(2982, 818, 0),
new Point3D(2985, 821, 0));
}
}
}

View file

@ -2,8 +2,7 @@ namespace Server.Factions
{
public class Yew : Town
{
public Yew()
{
public Yew() =>
Definition =
new TownDefinition(
4,
@ -19,6 +18,5 @@ namespace Server.Factions
new TextDefinition(1041390, "Corrupted Faction Town Sigil of Yew"),
new Point3D(548, 979, 0),
new Point3D(542, 980, 0));
}
}
}

View file

@ -5,10 +5,8 @@ namespace Server
public sealed class BloodRose : PowerFactionItem
{
public BloodRose()
: base(Utility.RandomList(6378, 9035))
{
: base(Utility.RandomList(6378, 9035)) =>
Hue = 2118;
}
public BloodRose(Serial serial)
: base(serial)

View file

@ -5,10 +5,8 @@ namespace Server
public sealed class ClarityPotion : PowerFactionItem
{
public ClarityPotion()
: base(3628)
{
: base(3628) =>
Hue = 1154;
}
public ClarityPotion(Serial serial)
: base(serial)

View file

@ -6,10 +6,8 @@ namespace Server
public sealed class GemOfEmpowerment : PowerFactionItem
{
public GemOfEmpowerment()
: base(7955)
{
: base(7955) =>
Hue = 1154;
}
public GemOfEmpowerment(Serial serial)
: base(serial)

View file

@ -65,10 +65,8 @@ namespace Server
try
{
using (StreamWriter op = new StreamWriter("faction-power-items.log", true))
{
op.WriteLine("{0}\t{1}\t{2}\t{3}", DateTime.UtcNow, killer, victim, obj);
}
using StreamWriter op = new StreamWriter("faction-power-items.log", true);
op.WriteLine("{0}\t{1}\t{2}\t{3}", DateTime.UtcNow, killer, victim, obj);
}
catch
{
@ -144,10 +142,8 @@ namespace Server
private bool _screamed;
public DestructionTimer(Mobile mob)
: base(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(0.1), 10)
{
: base(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(0.1), 10) =>
_mobile = mob;
}
protected override void OnTick()
{
@ -178,10 +174,7 @@ namespace Server
public Type Type{ get; }
public Item Construct()
{
return Activator.CreateInstance(Type) as Item;
}
public Item Construct() => Activator.CreateInstance(Type) as Item;
}
}
}

View file

@ -10,10 +10,8 @@ namespace Server
public sealed class StormsEye : PowerFactionItem
{
public StormsEye()
: base(3967)
{
: base(3967) =>
Hue = 1165;
}
public StormsEye(Serial serial)
: base(serial)

View file

@ -221,10 +221,7 @@ namespace Server.Factions
}
}
public static bool ExistsOn(Mobile mob)
{
return mob.Backpack?.FindItemByType<Sigil>() != null;
}
public static bool ExistsOn(Mobile mob) => mob.Backpack?.FindItemByType<Sigil>() != null;
private void BeginCorrupting(Faction faction)
{

View file

@ -105,10 +105,7 @@ namespace Server.Factions
public abstract void DoVisibleEffect();
public abstract void DoAttackEffect(Mobile m);
public virtual int IsValidLocation()
{
return IsValidLocation(GetWorldLocation(), Map);
}
public virtual int IsValidLocation() => IsValidLocation(GetWorldLocation(), Map);
public virtual int IsValidLocation(Point3D p, Map m)
{

View file

@ -467,10 +467,7 @@ namespace Server.Factions
{
private VirtualMountItem m_Item;
public VirtualMount(VirtualMountItem item)
{
m_Item = item;
}
public VirtualMount(VirtualMountItem item) => m_Item = item;
Mobile IMount.Rider
{
@ -495,10 +492,7 @@ namespace Server.Factions
m_Mount = new VirtualMount(this);
}
public VirtualMountItem(Serial serial) : base(serial)
{
m_Mount = new VirtualMount(this);
}
public VirtualMountItem(Serial serial) : base(serial) => m_Mount = new VirtualMount(this);
public Mobile Rider{ get; private set; }

View file

@ -108,10 +108,7 @@ namespace Server.Factions
private BaseFactionGuard m_Guard;
private DateTime m_ReleaseTarget;
public FactionGuardAI(BaseFactionGuard guard) : base(guard)
{
m_Guard = guard;
}
public FactionGuardAI(BaseFactionGuard guard) : base(guard) => m_Guard = guard;
public bool IsDamaged => m_Guard.Hits < m_Guard.HitsMax;
@ -142,10 +139,7 @@ namespace Server.Factions
}
}
public bool IsAllowed(GuardAI flag)
{
return (m_Guard.GuardAI & flag) == flag;
}
public bool IsAllowed(GuardAI flag) => (m_Guard.GuardAI & flag) == flag;
public bool DequipWeapon()
{
@ -343,11 +337,9 @@ namespace Server.Factions
return null;
}
public bool CanDispel(Mobile m)
{
return m is BaseCreature creature && creature.Summoned && m_Mobile.CanBeHarmful(creature, false) &&
!creature.IsAnimatedDead;
}
public bool CanDispel(Mobile m) =>
m is BaseCreature creature && creature.Summoned && m_Mobile.CanBeHarmful(creature, false) &&
!creature.IsAnimatedDead;
public void RunTo(Mobile m)
{

View file

@ -83,10 +83,7 @@ namespace Server.Factions
Unregister();
}
public override bool CheckVendorAccess(Mobile from)
{
return true;
}
public override bool CheckVendorAccess(Mobile from) => true;
public override void Serialize(GenericWriter writer)
{

View file

@ -24,10 +24,7 @@ namespace Server.Factions
{
}
public override int GetShoeHue()
{
return 0;
}
public override int GetShoeHue() => 0;
public override void InitOutfit()
{
@ -51,15 +48,9 @@ namespace Server.Factions
{
}
public override bool OnBuyItems(Mobile buyer, List<BuyItemResponse> list)
{
return false;
}
public override bool OnBuyItems(Mobile buyer, List<BuyItemResponse> list) => false;
public override bool OnSellItems(Mobile seller, List<SellItemResponse> list)
{
return false;
}
public override bool OnSellItems(Mobile seller, List<SellItemResponse> list) => false;
public override void Serialize(GenericWriter writer)
{