2024-02-21 14:47:37 +00:00
|
|
|
|
using Core.Config;
|
|
|
|
|
using Protocol;
|
|
|
|
|
|
|
|
|
|
namespace GameServer.Models;
|
|
|
|
|
internal class RoleModel
|
|
|
|
|
{
|
|
|
|
|
public List<roleInfo> Roles { get; } = [];
|
|
|
|
|
|
|
|
|
|
public roleInfo Create(int id)
|
|
|
|
|
{
|
|
|
|
|
roleInfo info = new()
|
|
|
|
|
{
|
|
|
|
|
RoleId = id,
|
|
|
|
|
Level = 1,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
Roles.Add(info);
|
|
|
|
|
return info;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-21 21:14:56 +00:00
|
|
|
|
public roleInfo? GetRoleById(int roleId)
|
|
|
|
|
{
|
|
|
|
|
return Roles.SingleOrDefault(role => role.RoleId == roleId);
|
|
|
|
|
}
|
2024-02-21 14:47:37 +00:00
|
|
|
|
}
|