Adds style cop (#109)
This commit is contained in:
parent
3e715bcb60
commit
556a17aba8
1725 changed files with 33831 additions and 38046 deletions
|
|
@ -35,43 +35,42 @@ namespace Server.Guilds
|
|||
private readonly BufferWriter m_SaveBuffer;
|
||||
public BufferWriter SaveBuffer => m_SaveBuffer;
|
||||
|
||||
private static uint m_NextID = 1;
|
||||
private static Serial m_NextID = 1;
|
||||
|
||||
protected BaseGuild(uint Id) //serialization ctor
|
||||
protected BaseGuild(uint id) // serialization ctor
|
||||
{
|
||||
this.Id = Id;
|
||||
List.Add(this.Id, this);
|
||||
if (this.Id + 1 > m_NextID)
|
||||
m_NextID = this.Id + 1;
|
||||
this.Serial = id;
|
||||
List.Add(this.Serial, this);
|
||||
if (this.Serial + 1 > m_NextID)
|
||||
m_NextID = this.Serial + 1;
|
||||
m_SaveBuffer = new BufferWriter(true);
|
||||
}
|
||||
|
||||
protected BaseGuild()
|
||||
{
|
||||
Id = m_NextID++;
|
||||
List.Add(Id, this);
|
||||
Serial = m_NextID++;
|
||||
List.Add(Serial, this);
|
||||
m_SaveBuffer = new BufferWriter(true);
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor)]
|
||||
public uint Id{ get; }
|
||||
public Serial Serial { get; }
|
||||
|
||||
public abstract string Abbreviation{ get; set; }
|
||||
public abstract string Name{ get; set; }
|
||||
public abstract GuildType Type{ get; set; }
|
||||
public abstract bool Disbanded{ get; }
|
||||
public abstract string Abbreviation { get; set; }
|
||||
public abstract string Name { get; set; }
|
||||
public abstract GuildType Type { get; set; }
|
||||
public abstract bool Disbanded { get; }
|
||||
|
||||
public static Dictionary<uint, BaseGuild> List{ get; } = new Dictionary<uint, BaseGuild>();
|
||||
public static Dictionary<uint, BaseGuild> List { get; } = new Dictionary<uint, BaseGuild>();
|
||||
|
||||
int ISerializable.TypeReference => 0;
|
||||
|
||||
uint ISerializable.SerialIdentity => Id;
|
||||
public int TypeRef => 0;
|
||||
|
||||
public void Serialize()
|
||||
{
|
||||
SaveBuffer.Flush();
|
||||
Serialize(SaveBuffer);
|
||||
}
|
||||
|
||||
public abstract void Serialize(IGenericWriter writer);
|
||||
|
||||
public abstract void Deserialize(IGenericReader reader);
|
||||
|
|
@ -79,7 +78,7 @@ namespace Server.Guilds
|
|||
|
||||
public static BaseGuild Find(uint id)
|
||||
{
|
||||
List.TryGetValue(id, out BaseGuild g);
|
||||
List.TryGetValue(id, out var g);
|
||||
|
||||
return g;
|
||||
}
|
||||
|
|
@ -90,12 +89,12 @@ namespace Server.Guilds
|
|||
|
||||
public static List<BaseGuild> Search(string find)
|
||||
{
|
||||
string[] words = find.ToLower().Split(' ');
|
||||
List<BaseGuild> results = new List<BaseGuild>();
|
||||
var words = find.ToLower().Split(' ');
|
||||
var results = new List<BaseGuild>();
|
||||
|
||||
foreach (BaseGuild g in List.Values)
|
||||
foreach (var g in List.Values)
|
||||
{
|
||||
string name = g.Name.ToLower();
|
||||
var name = g.Name.ToLower();
|
||||
|
||||
if (words.All(t => name.IndexOf(t) != -1))
|
||||
results.Add(g);
|
||||
|
|
@ -104,6 +103,6 @@ namespace Server.Guilds
|
|||
return results;
|
||||
}
|
||||
|
||||
public override string ToString() => $"0x{Id:X} \"{Name} [{Abbreviation}]\"";
|
||||
public override string ToString() => $"0x{Serial:X} \"{Name} [{Abbreviation}]\"";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue