2023-09-23 12:20:45 +00:00
|
|
|
using FluentNHibernate.Mapping;
|
|
|
|
|
|
|
|
namespace Tiger.Game.Habbos;
|
|
|
|
|
|
|
|
public class HabboMap : ClassMap<Habbo>
|
|
|
|
{
|
|
|
|
public HabboMap()
|
|
|
|
{
|
|
|
|
Table("habbos");
|
|
|
|
LazyLoad();
|
|
|
|
Id(h => h.Id).Column("id").GeneratedBy.Identity();
|
|
|
|
Map(h => h.Username).Column("username").Not.Nullable();
|
|
|
|
Map(h => h.Email).Column("email").Not.Nullable();
|
|
|
|
Map(h => h.AccountCreated).Column("account_created").Not.Nullable();
|
|
|
|
Map(h => h.LastLogin).Column("last_login").Nullable();
|
|
|
|
Map(h => h.Motto).Column("motto").Not.Nullable();
|
|
|
|
Map(h => h.Figure).Column("figure").Not.Nullable();
|
|
|
|
Map(h => h.Gender).Column("gender").Not.Nullable();
|
|
|
|
Map(h => h.Rank).Column("rank").Not.Nullable();
|
|
|
|
Map(h => h.Credits).Column("credits").Not.Nullable();
|
|
|
|
Map(h => h.Online).Column("online").Not.Nullable();
|
|
|
|
Map(h => h.HomeRoom).Column("home_room").Not.Nullable();
|
|
|
|
Map(h => h.AchievementScore).Column("achievement_score").Not.Nullable();
|
|
|
|
Map(h => h.GroupId).Column("group_id").Nullable();
|
|
|
|
Map(h => h.SsoTicket).Column("sso_ticket").Nullable();
|
2023-10-07 13:32:19 +00:00
|
|
|
HasMany(h => h.Activitypoints).AsMap(a => a.Type).Inverse().Cascade.All();
|
|
|
|
HasMany(h => h.Badges).Inverse().Cascade.All();
|
|
|
|
HasMany(x => x.Achievements)
|
|
|
|
.Table("habbo_achievements")
|
|
|
|
.KeyColumn("habbo_id")
|
|
|
|
.Component(comp =>
|
|
|
|
{
|
|
|
|
comp.Map(x => x.Level);
|
|
|
|
comp.Map(x => x.Progress);
|
|
|
|
})
|
|
|
|
.AsMap("achievement_id")
|
|
|
|
.Cascade.All();
|
2023-10-21 05:19:21 +00:00
|
|
|
HasMany(h => h.Subscriptions).Cascade.All().Inverse();
|
2023-09-23 12:20:45 +00:00
|
|
|
}
|
|
|
|
}
|