Files
AdamuSw/src/Persistence/EntityFramework/Model/GameConfiguration.Generated.cs
Acentech Dev af46499279 fix(build): run the persistence generator against the current data model
The PreBuild targets ran the generator with "--no-build", so it used whatever
assemblies happened to sit in its output folder. When that copy of the data model
was older than a newly added type, the generator regenerated the checked-in
*.Generated.cs files WITHOUT that type and overwrote them in the source tree.

Nothing failed at build time: the C# compile stayed green and docker builds
(-p:ci=true) skip the generator entirely, so they compiled whatever was in the
tree. The damage only surfaced at runtime, when EF validated the model and found
the inherited GameConfiguration.CastleSiegeConfiguration navigation pointing at a
keyless type - the server died on startup with "The entity type
'CastleSiegeConfiguration' requires a primary key to be defined".

Dropping the switch makes the generator build first, so its output always matches
the data model. The regenerated files here are that missing output: the Castle
Siege mappings, and the packet tests for packets whose XML was already committed.

TypedContextModelTests builds the typed context the startup reads its plugin
configurations through - the first one to touch the model - so this class of
breakage fails in seconds without a database.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-04 21:43:39 +03:00

307 lines
14 KiB
C#

// <copyright file="GameConfiguration.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.GameConfiguration"/>.
/// </summary>
[Table(nameof(GameConfiguration), Schema = SchemaNames.Configuration)]
internal partial class GameConfiguration : MUnique.OpenMU.DataModel.Configuration.GameConfiguration, IIdentifiable
{
/// <summary>
/// Gets or sets the identifier of this instance.
/// </summary>
public Guid Id { get; set; }
/// <summary>
/// Gets the raw collection of <see cref="JewelMixes" />.
/// </summary>
public ICollection<JewelMix> RawJewelMixes { get; } = new EntityFramework.List<JewelMix>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.JewelMix> JewelMixes => base.JewelMixes ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.JewelMix, JewelMix>(this.RawJewelMixes);
/// <summary>
/// Gets the raw collection of <see cref="WarpList" />.
/// </summary>
public ICollection<WarpInfo> RawWarpList { get; } = new EntityFramework.List<WarpInfo>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.WarpInfo> WarpList => base.WarpList ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.WarpInfo, WarpInfo>(this.RawWarpList);
/// <summary>
/// Gets the raw collection of <see cref="DropItemGroups" />.
/// </summary>
public ICollection<DropItemGroup> RawDropItemGroups { get; } = new EntityFramework.List<DropItemGroup>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.DropItemGroup> DropItemGroups => base.DropItemGroups ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.DropItemGroup, DropItemGroup>(this.RawDropItemGroups);
/// <summary>
/// Gets the raw collection of <see cref="Skills" />.
/// </summary>
public ICollection<Skill> RawSkills { get; } = new EntityFramework.List<Skill>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Skill> Skills => base.Skills ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Skill, Skill>(this.RawSkills);
/// <summary>
/// Gets the raw collection of <see cref="CharacterClasses" />.
/// </summary>
public ICollection<CharacterClass> RawCharacterClasses { get; } = new EntityFramework.List<CharacterClass>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.CharacterClass> CharacterClasses => base.CharacterClasses ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.CharacterClass, CharacterClass>(this.RawCharacterClasses);
/// <summary>
/// Gets the raw collection of <see cref="Items" />.
/// </summary>
public ICollection<ItemDefinition> RawItems { get; } = new EntityFramework.List<ItemDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemDefinition> Items => base.Items ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemDefinition, ItemDefinition>(this.RawItems);
/// <summary>
/// Gets the raw collection of <see cref="ItemLevelBonusTables" />.
/// </summary>
public ICollection<ItemLevelBonusTable> RawItemLevelBonusTables { get; } = new EntityFramework.List<ItemLevelBonusTable>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemLevelBonusTable> ItemLevelBonusTables => base.ItemLevelBonusTables ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemLevelBonusTable, ItemLevelBonusTable>(this.RawItemLevelBonusTables);
/// <summary>
/// Gets the raw collection of <see cref="ItemSlotTypes" />.
/// </summary>
public ICollection<ItemSlotType> RawItemSlotTypes { get; } = new EntityFramework.List<ItemSlotType>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemSlotType> ItemSlotTypes => base.ItemSlotTypes ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemSlotType, ItemSlotType>(this.RawItemSlotTypes);
/// <summary>
/// Gets the raw collection of <see cref="ItemOptions" />.
/// </summary>
public ICollection<ItemOptionDefinition> RawItemOptions { get; } = new EntityFramework.List<ItemOptionDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemOptionDefinition> ItemOptions => base.ItemOptions ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemOptionDefinition, ItemOptionDefinition>(this.RawItemOptions);
/// <summary>
/// Gets the raw collection of <see cref="ItemOptionTypes" />.
/// </summary>
public ICollection<ItemOptionType> RawItemOptionTypes { get; } = new EntityFramework.List<ItemOptionType>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemOptionType> ItemOptionTypes => base.ItemOptionTypes ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemOptionType, ItemOptionType>(this.RawItemOptionTypes);
/// <summary>
/// Gets the raw collection of <see cref="ItemSetGroups" />.
/// </summary>
public ICollection<ItemSetGroup> RawItemSetGroups { get; } = new EntityFramework.List<ItemSetGroup>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemSetGroup> ItemSetGroups => base.ItemSetGroups ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemSetGroup, ItemSetGroup>(this.RawItemSetGroups);
/// <summary>
/// Gets the raw collection of <see cref="ItemOptionCombinationBonuses" />.
/// </summary>
public ICollection<ItemOptionCombinationBonus> RawItemOptionCombinationBonuses { get; } = new EntityFramework.List<ItemOptionCombinationBonus>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.Items.ItemOptionCombinationBonus> ItemOptionCombinationBonuses => base.ItemOptionCombinationBonuses ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.Items.ItemOptionCombinationBonus, ItemOptionCombinationBonus>(this.RawItemOptionCombinationBonuses);
/// <summary>
/// Gets the raw collection of <see cref="Maps" />.
/// </summary>
public ICollection<GameMapDefinition> RawMaps { get; } = new EntityFramework.List<GameMapDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.GameMapDefinition> Maps => base.Maps ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.GameMapDefinition, GameMapDefinition>(this.RawMaps);
/// <summary>
/// Gets the raw collection of <see cref="Monsters" />.
/// </summary>
public ICollection<MonsterDefinition> RawMonsters { get; } = new EntityFramework.List<MonsterDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.MonsterDefinition> Monsters => base.Monsters ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.MonsterDefinition, MonsterDefinition>(this.RawMonsters);
/// <summary>
/// Gets the raw collection of <see cref="Attributes" />.
/// </summary>
public ICollection<AttributeDefinition> RawAttributes { get; } = new EntityFramework.List<AttributeDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.AttributeSystem.AttributeDefinition> Attributes => base.Attributes ??= new CollectionAdapter<MUnique.OpenMU.AttributeSystem.AttributeDefinition, AttributeDefinition>(this.RawAttributes);
/// <summary>
/// Gets the raw collection of <see cref="MagicEffects" />.
/// </summary>
public ICollection<MagicEffectDefinition> RawMagicEffects { get; } = new EntityFramework.List<MagicEffectDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.MagicEffectDefinition> MagicEffects => base.MagicEffects ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.MagicEffectDefinition, MagicEffectDefinition>(this.RawMagicEffects);
/// <summary>
/// Gets the raw collection of <see cref="MasterSkillRoots" />.
/// </summary>
public ICollection<MasterSkillRoot> RawMasterSkillRoots { get; } = new EntityFramework.List<MasterSkillRoot>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.MasterSkillRoot> MasterSkillRoots => base.MasterSkillRoots ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.MasterSkillRoot, MasterSkillRoot>(this.RawMasterSkillRoots);
/// <summary>
/// Gets the raw collection of <see cref="GlobalAttributeCombinations" />.
/// </summary>
public ICollection<AttributeRelationship> RawGlobalAttributeCombinations { get; } = new EntityFramework.List<AttributeRelationship>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.AttributeSystem.AttributeRelationship> GlobalAttributeCombinations => base.GlobalAttributeCombinations ??= new CollectionAdapter<MUnique.OpenMU.AttributeSystem.AttributeRelationship, AttributeRelationship>(this.RawGlobalAttributeCombinations);
/// <summary>
/// Gets the raw collection of <see cref="GlobalBaseAttributeValues" />.
/// </summary>
public ICollection<ConstValueAttribute> RawGlobalBaseAttributeValues { get; } = new EntityFramework.List<ConstValueAttribute>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.AttributeSystem.ConstValueAttribute> GlobalBaseAttributeValues => base.GlobalBaseAttributeValues ??= new CollectionAdapter<MUnique.OpenMU.AttributeSystem.ConstValueAttribute, ConstValueAttribute>(this.RawGlobalBaseAttributeValues);
/// <summary>
/// Gets the raw collection of <see cref="PlugInConfigurations" />.
/// </summary>
public ICollection<PlugInConfiguration> RawPlugInConfigurations { get; } = new EntityFramework.List<PlugInConfiguration>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.PlugIns.PlugInConfiguration> PlugInConfigurations => base.PlugInConfigurations ??= new CollectionAdapter<MUnique.OpenMU.PlugIns.PlugInConfiguration, PlugInConfiguration>(this.RawPlugInConfigurations);
/// <summary>
/// Gets the raw collection of <see cref="MiniGameDefinitions" />.
/// </summary>
public ICollection<MiniGameDefinition> RawMiniGameDefinitions { get; } = new EntityFramework.List<MiniGameDefinition>();
/// <inheritdoc/>
[NotMapped]
public override ICollection<MUnique.OpenMU.DataModel.Configuration.MiniGameDefinition> MiniGameDefinitions => base.MiniGameDefinitions ??= new CollectionAdapter<MUnique.OpenMU.DataModel.Configuration.MiniGameDefinition, MiniGameDefinition>(this.RawMiniGameDefinitions);
/// <summary>
/// Gets or sets the identifier of <see cref="DuelConfiguration"/>.
/// </summary>
public Guid? DuelConfigurationId { get; set; }
/// <summary>
/// Gets the raw object of <see cref="DuelConfiguration" />.
/// </summary>
[ForeignKey(nameof(DuelConfigurationId))]
public DuelConfiguration RawDuelConfiguration
{
get => base.DuelConfiguration as DuelConfiguration;
set => base.DuelConfiguration = value;
}
/// <inheritdoc/>
[NotMapped]
public override MUnique.OpenMU.DataModel.Configuration.DuelConfiguration DuelConfiguration
{
get => base.DuelConfiguration;set
{
base.DuelConfiguration = value;
this.DuelConfigurationId = this.RawDuelConfiguration?.Id;
}
}
/// <summary>
/// Gets or sets the identifier of <see cref="CastleSiegeConfiguration"/>.
/// </summary>
public Guid? CastleSiegeConfigurationId { get; set; }
/// <summary>
/// Gets the raw object of <see cref="CastleSiegeConfiguration" />.
/// </summary>
[ForeignKey(nameof(CastleSiegeConfigurationId))]
public CastleSiegeConfiguration RawCastleSiegeConfiguration
{
get => base.CastleSiegeConfiguration as CastleSiegeConfiguration;
set => base.CastleSiegeConfiguration = value;
}
/// <inheritdoc/>
[NotMapped]
public override MUnique.OpenMU.DataModel.Configuration.CastleSiegeConfiguration CastleSiegeConfiguration
{
get => base.CastleSiegeConfiguration;set
{
base.CastleSiegeConfiguration = value;
this.CastleSiegeConfigurationId = this.RawCastleSiegeConfiguration?.Id;
}
}
/// <inheritdoc />
public override MUnique.OpenMU.DataModel.Configuration.GameConfiguration Clone(MUnique.OpenMU.DataModel.Configuration.GameConfiguration gameConfiguration)
{
var clone = new GameConfiguration();
clone.AssignValuesOf(this, gameConfiguration);
return clone;
}
/// <inheritdoc />
public override void AssignValuesOf(MUnique.OpenMU.DataModel.Configuration.GameConfiguration 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();
}
}