mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-04-23 04:29:36 +08:00
37 lines
1.2 KiB
C#
37 lines
1.2 KiB
C#
using Milimoe.FunGame.Core.Entity;
|
|
using Milimoe.FunGame.Core.Interface.Base;
|
|
using Milimoe.FunGame.Core.Library.Constant;
|
|
|
|
namespace Milimoe.FunGame.Core.Api.Factory
|
|
{
|
|
internal class UserFactory : IFactory<User>
|
|
{
|
|
public Type EntityType => typeof(User);
|
|
|
|
public User Create()
|
|
{
|
|
return General.UnknownUserInstance;
|
|
}
|
|
|
|
public static User Create(long Id = 0, string Username = "", DateTime? RegTime = null, DateTime? LastTime = null, string Email = "", string NickName = "", bool IsAdmin = false, bool IsOperator = false, bool IsEnable = true, double Credits = 0, double Materials = 0, double GameTime = 0, string AutoKey = "")
|
|
{
|
|
return new(Id, Username, RegTime, LastTime, Email, NickName, IsAdmin, IsOperator, IsEnable, Credits, Materials, GameTime, AutoKey);
|
|
}
|
|
|
|
public static User Create(UserType type)
|
|
{
|
|
return new(type);
|
|
}
|
|
|
|
public static User CreateGuest()
|
|
{
|
|
return General.GuestUserInstance;
|
|
}
|
|
|
|
public static User CreateLocalUser()
|
|
{
|
|
return General.LocalUserInstance;
|
|
}
|
|
}
|
|
}
|