Add Club (#23)

This commit is contained in:
milimoe 2023-05-21 14:02:18 +08:00 committed by GitHub
parent d7609de7f6
commit 185fea4b40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 10 deletions

27
Entity/System/Club.cs Normal file
View File

@ -0,0 +1,27 @@
using Milimoe.FunGame.Core.Interface.Entity;
namespace Milimoe.FunGame.Core.Entity
{
public class Club : BaseEntity
{
public string Prefix { get; set; } = "";
public string Description { get; set; } = "";
public bool IsNeedApproval { get; set; } = false;
public bool IsPublic { get; set; } = false;
public decimal ClubPoins { get; set; } = 0M;
public User? Master { get; set; }
public Dictionary<string, User> Admins { get; set; } = new();
public Dictionary<string, User> Members { get; set; } = new();
public Dictionary<string, User> Applicants { get; set; } = new();
public bool Equals(Club other)
{
return Equals(other);
}
public override bool Equals(IBaseEntity? other)
{
return other?.Id == Id;
}
}
}

View File

@ -1,13 +1,11 @@
using System.Collections; namespace Milimoe.FunGame.Core.Entity
namespace Milimoe.FunGame.Core.Entity
{ {
public class Inventory public class Inventory
{ {
public int Id { get; set; } public int Id { get; set; }
public string Name { get; set; } = ""; public string Name { get; set; } = "";
public User? User { get; set; } = null; public User? User { get; set; } = null;
public Hashtable? Characters { get; set; } = new Hashtable(); public Dictionary<string, Character> Characters { get; set; } = new();
public Hashtable? Items { get; set; } = new Hashtable(); public Dictionary<string, Item> Items { get; set; } = new();
} }
} }

View File

@ -1,9 +1,7 @@
using System.Data; using System.Data;
using System.Collections;
using Milimoe.FunGame.Core.Interface.Entity; using Milimoe.FunGame.Core.Interface.Entity;
using Milimoe.FunGame.Core.Library.Constant; using Milimoe.FunGame.Core.Library.Constant;
using Milimoe.FunGame.Core.Library.SQLScript.Entity; using Milimoe.FunGame.Core.Library.SQLScript.Entity;
using System.Linq;
namespace Milimoe.FunGame.Core.Entity namespace Milimoe.FunGame.Core.Entity
{ {
@ -12,7 +10,7 @@ namespace Milimoe.FunGame.Core.Entity
public override long Id { get => base.Id ; set => base.Id = value; } public override long Id { get => base.Id ; set => base.Id = value; }
public string Roomid { get; set; } = ""; public string Roomid { get; set; } = "";
public DateTime CreateTime { get; set; } = DateTime.Now; public DateTime CreateTime { get; set; } = DateTime.Now;
public Hashtable PlayerList { get; set; } = new Hashtable(); public Dictionary<string, User> Players { get; set; } = new();
public User? RoomMaster { get; set; } public User? RoomMaster { get; set; }
public RoomType RoomType { get; set; } public RoomType RoomType { get; set; }
public RoomState RoomState { get; set; } public RoomState RoomState { get; set; }
@ -47,12 +45,12 @@ namespace Milimoe.FunGame.Core.Entity
public bool Equals(Room other) public bool Equals(Room other)
{ {
return other.Id == Id; return Equals(other);
} }
public override bool Equals(IBaseEntity? other) public override bool Equals(IBaseEntity? other)
{ {
return Equals(other); return other?.Id == Id;
} }
private static int GetUserRowIndex(DataSet? DsUser, long UID) private static int GetUserRowIndex(DataSet? DsUser, long UID)