//
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
//------------------------------------------------------------------------------
//
// This source code was auto-generated by a roslyn code generator.
//
//------------------------------------------------------------------------------
// ReSharper disable All
namespace MUnique.OpenMU.Persistence.EntityFramework.Model;
using System.ComponentModel.DataAnnotations.Schema;
using MUnique.OpenMU.Persistence;
///
/// The Entity Framework Core implementation of .
///
[Table(nameof(MonsterDefinition), Schema = SchemaNames.Configuration)]
internal partial class MonsterDefinition : MUnique.OpenMU.DataModel.Configuration.MonsterDefinition, IIdentifiable
{
///
public MonsterDefinition()
{
this.InitJoinCollections();
}
///
/// Gets or sets the identifier of this instance.
///
public Guid Id { get; set; }
///
/// Gets the raw collection of .
///
public ICollection RawItemCraftings { get; } = new EntityFramework.List();
///
[NotMapped]
public override ICollection ItemCraftings => base.ItemCraftings ??= new CollectionAdapter(this.RawItemCraftings);
///
/// Gets the raw collection of .
///
public ICollection RawAttributes { get; } = new EntityFramework.List();
///
[NotMapped]
public override ICollection Attributes => base.Attributes ??= new CollectionAdapter(this.RawAttributes);
///
/// Gets the raw collection of .
///
public ICollection RawQuests { get; } = new EntityFramework.List();
///
[NotMapped]
public override ICollection Quests => base.Quests ??= new CollectionAdapter(this.RawQuests);
///
/// Gets the raw collection of .
///
public ICollection RawBuffs { get; } = new EntityFramework.List();
///
[NotMapped]
public override ICollection Buffs => base.Buffs ??= new CollectionAdapter(this.RawBuffs);
///
/// Gets or sets the identifier of .
///
public Guid? AttackSkillId { get; set; }
///
/// Gets the raw object of .
///
[ForeignKey(nameof(AttackSkillId))]
public Skill RawAttackSkill
{
get => base.AttackSkill as Skill;
set => base.AttackSkill = value;
}
///
[NotMapped]
public override MUnique.OpenMU.DataModel.Configuration.Skill AttackSkill
{
get => base.AttackSkill;set
{
base.AttackSkill = value;
this.AttackSkillId = this.RawAttackSkill?.Id;
}
}
///
/// Gets or sets the identifier of .
///
public Guid? MerchantStoreId { get; set; }
///
/// Gets the raw object of .
///
[ForeignKey(nameof(MerchantStoreId))]
public ItemStorage RawMerchantStore
{
get => base.MerchantStore as ItemStorage;
set => base.MerchantStore = value;
}
///
[NotMapped]
public override MUnique.OpenMU.DataModel.Entities.ItemStorage MerchantStore
{
get => base.MerchantStore;set
{
base.MerchantStore = value;
this.MerchantStoreId = this.RawMerchantStore?.Id;
}
}
///
public override MUnique.OpenMU.DataModel.Configuration.MonsterDefinition Clone(MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration)
{
var clone = new MonsterDefinition();
clone.AssignValuesOf(this, gameConfiguration);
return clone;
}
///
public override void AssignValuesOf(MUnique.OpenMU.DataModel.Configuration.MonsterDefinition other, MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration)
{
base.AssignValuesOf(other, gameConfiguration);
this.Id = other.GetId();
}
///
public override bool Equals(object obj)
{
var baseObject = obj as IIdentifiable;
if (baseObject != null)
{
return baseObject.Id == this.Id;
}
return base.Equals(obj);
}
///
public override int GetHashCode()
{
return this.Id.GetHashCode();
}
protected void InitJoinCollections()
{
this.DropItemGroups = new ManyToManyCollectionAdapter(this.JoinedDropItemGroups, joinEntity => joinEntity.DropItemGroup, entity => new MonsterDefinitionDropItemGroup { MonsterDefinition = this, MonsterDefinitionId = this.Id, DropItemGroup = (DropItemGroup)entity, DropItemGroupId = ((DropItemGroup)entity).Id});
}
}