Files
AdamuSw/src/Persistence/EntityFramework/Model/MonsterDefinition.Generated.cs
sven-n d22ec20a04 Merge pull request #825 from eduardosmaniotto/feature/configurable-npc-buffs
feature: configurable npc buffs
(cherry picked from commit 6a061fcad756e644dadf3721e84e3cce2a25bceb)
2026-07-23 11:37:22 +03:00

162 lines
5.9 KiB
C#

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