TigerEmu/Game/Rooms/RoomMap.cs

29 lines
1.2 KiB
C#
Raw Permalink Normal View History

using FluentNHibernate.Mapping;
2023-11-10 13:55:42 +00:00
using Tiger.Storage.CustomTypes;
namespace Tiger.Game.Rooms;
public class RoomMap : ClassMap<Room>
{
public RoomMap()
{
Table("rooms");
2023-11-10 13:55:42 +00:00
LazyLoad();
Id(r => r.Id).Column("id").GeneratedBy.Identity();
Map(r => r.Name).Column("name").Not.Nullable();
Map(r => r.Description).Column("description").Not.Nullable();
Map(r => r.ModelId).Column("model_id").Not.Nullable();
Map(r => r.Password).Column("password").Not.Nullable();
Map(r => r.AccessType).Column("access_type").CustomType<EnumTypeConverter<RoomAccessType>>().Not.Nullable();
Map(r => r.UsersIn).Column("users_in").Not.Nullable();
Map(r => r.UsersMax).Column("users_max").Not.Nullable();
Map(r => r.Floor).Column("floor").Not.Nullable();
Map(r => r.Wallpaper).Column("wallpaper").Not.Nullable();
Map(r => r.Ccts).Column("ccts").Not.Nullable();
Map(r => r.ShowOwner).Column("show_owner").Not.Nullable();
Map(r => r.Superusers).Column("super_users").Not.Nullable();
References(r => r.Category).Column("category_id").Not.Nullable();
References(r => r.Owner).Column("owner_id").Nullable();
}
}