mirror of
https://github.com/9ParsonsB/Pulsar.git
synced 2025-07-02 17:03:41 -04:00
Add Startup Events to Database
Now emit startup events on conneciton Some events still to add
This commit is contained in:
17
Pulsar/Context/Configuration/BackpackCofiguration.cs
Normal file
17
Pulsar/Context/Configuration/BackpackCofiguration.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using JasperFx.Core;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files;
|
||||
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
public class BackpackCofiguration : IEntityTypeConfiguration<BackpackFile>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<BackpackFile> builder)
|
||||
{
|
||||
builder.OwnsMany(b => b.Components, b => b.ToJson());
|
||||
builder.OwnsMany(b => b.Consumables, b => b.ToJson());
|
||||
builder.OwnsMany(b => b.Items, b => b.ToJson());
|
||||
builder.OwnsMany(b => b.Data, b => b.ToJson());
|
||||
}
|
||||
}
|
13
Pulsar/Context/Configuration/CargoConfiguration.cs
Normal file
13
Pulsar/Context/Configuration/CargoConfiguration.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
public class CargoConfiguration : IEntityTypeConfiguration<Cargo>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Cargo> builder)
|
||||
{
|
||||
builder.OwnsMany(c => c.Inventory, c => c.ToJson());
|
||||
}
|
||||
}
|
26
Pulsar/Context/Configuration/LoadoutConfiguration.cs
Normal file
26
Pulsar/Context/Configuration/LoadoutConfiguration.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Startup;
|
||||
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
public class LoadoutConfiguration : IEntityTypeConfiguration<Loadout>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Loadout> builder)
|
||||
{
|
||||
builder.OwnsMany(l => l.Modules, lb =>
|
||||
{
|
||||
lb.OwnsOne(m => m.Engineering, mb =>
|
||||
{
|
||||
mb.OwnsMany(e => e.Modifiers, eb =>
|
||||
{
|
||||
eb.OwnsOne(em => em.Value, emb => emb.ToJson());
|
||||
eb.ToJson();
|
||||
});
|
||||
mb.ToJson();
|
||||
});
|
||||
lb.ToJson();
|
||||
});
|
||||
builder.OwnsOne(l => l.FuelCapacity, b=>b.ToJson());
|
||||
}
|
||||
}
|
34
Pulsar/Context/Configuration/LocationConfiguration.cs
Normal file
34
Pulsar/Context/Configuration/LocationConfiguration.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Travel;
|
||||
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
public class LocationConfiguration : IEntityTypeConfiguration<Location>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Location> builder)
|
||||
{
|
||||
builder.OwnsOne(l => l.StarPos, b => b.ToJson());
|
||||
builder.OwnsMany(l => l.Conflicts, b =>
|
||||
{
|
||||
b.OwnsOne(c => c.FirstFaction, c => c.ToJson());
|
||||
b.OwnsOne(c => c.SecondFaction, c => c.ToJson());
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsOne(l => l.StationFaction, b => b.ToJson());
|
||||
builder.OwnsOne(l => l.SystemFaction, b =>
|
||||
{
|
||||
b.OwnsMany(s => s.ActiveStates, sb => sb.ToJson());
|
||||
b.OwnsMany(s => s.RecoveringStates, rb => rb.ToJson());
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsMany(l => l.Factions, b =>
|
||||
{
|
||||
b.OwnsMany(f => f.ActiveStates, fb => fb.ToJson());
|
||||
b.OwnsMany(f => f.RecoveringStates, rb => rb.ToJson());
|
||||
b.ToJson();
|
||||
});
|
||||
builder.OwnsMany(l => l.StationEconomies, sb => sb.ToJson());
|
||||
builder.OwnsOne(l => l.ThargoidWar, tb => tb.ToJson());
|
||||
}
|
||||
}
|
16
Pulsar/Context/Configuration/ShipLockerConfiguration.cs
Normal file
16
Pulsar/Context/Configuration/ShipLockerConfiguration.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
using Observatory.Framework.Files.Journal.Odyssey;
|
||||
|
||||
namespace Pulsar.Context.Configuration;
|
||||
|
||||
public class ShipLockerConfiguration : IEntityTypeConfiguration<ShipLockerMaterials>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ShipLockerMaterials> builder)
|
||||
{
|
||||
builder.OwnsMany(b => b.Items, b => b.ToJson());
|
||||
builder.OwnsMany(b => b.Components, b => b.ToJson());
|
||||
builder.OwnsMany(b => b.Consumables, b => b.ToJson());
|
||||
builder.OwnsMany(b => b.Data, b => b.ToJson());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user