SES-143 Add monster related reposittories and ViewModel
This commit is contained in:
parent
f31b41f942
commit
fad8b27797
@ -127,3 +127,4 @@ namespace SessionCompanion.Database
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class GameActionRepository : Repository<GameAction>, IRepository<GameAction>
|
||||
{
|
||||
public GameActionRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class LegendaryActionRepository : Repository<LegendaryAction>, IRepository<LegendaryAction>
|
||||
{
|
||||
public LegendaryActionRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class MonsterActionsRepository : Repository<MonsterAction>, IRepository<MonsterAction>
|
||||
{
|
||||
public MonsterActionsRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class MonsterLegendaryActionsRepository : Repository<MonsterLegendaryAction>, IRepository<MonsterLegendaryAction>
|
||||
{
|
||||
public MonsterLegendaryActionsRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class MonsterRepository : Repository<Monster>, IRepository<Monster>
|
||||
{
|
||||
public MonsterRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class MonsterSpecialAbilitiesRepository : Repository<MonsterSpecialAbility>, IRepository<MonsterSpecialAbility>
|
||||
{
|
||||
public MonsterSpecialAbilitiesRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
using SessionCompanion.Database.Repositories.Base;
|
||||
using SessionCompanion.Database.Tables;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.Database.Repositories
|
||||
{
|
||||
public class SpecialAbilityRepository : Repository<SpecialAbility>, IRepository<SpecialAbility>
|
||||
{
|
||||
public SpecialAbilityRepository(ApplicationDbContext _dbContext) : base(_dbContext)
|
||||
{ }
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.GameActionViewModels
|
||||
{
|
||||
public class GameActionViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opis akcji
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
public int AttackBonus { get; set; }
|
||||
|
||||
public int? DamageDice { get; set; }
|
||||
public int? DamageDiceAmount { get; set; }
|
||||
|
||||
public int? DamageBonus { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.LegendaryActionViewModels
|
||||
{
|
||||
public class LegendaryActionViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
// <summary>
|
||||
/// Nazwa legendarnej akcji
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opis akcji
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.MonsterActionsViewModels
|
||||
{
|
||||
public class MonsterActionsViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Id potwora
|
||||
/// </summary>
|
||||
public int MonsterId { get; set; }
|
||||
|
||||
public int GameActionId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.MonsterLegendaryActionsViewModels
|
||||
{
|
||||
public class MonsterLegendaryActionsViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MonsterId { get; set; }
|
||||
public int LegendaryActionId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.MonsterSpecialAbilitiesViewModels
|
||||
{
|
||||
public class MonsterSpecialAbilitiesViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int MonsterId { get; set; }
|
||||
public int LegendaryActionId { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.MonsterViewModels
|
||||
{
|
||||
using SessionCompanion.ViewModels.GameActionViewModels;
|
||||
using SessionCompanion.ViewModels.LegendaryActionViewModels;
|
||||
using SessionCompanion.ViewModels.SpecialAbilityViewModels;
|
||||
|
||||
public class MonsterAllInformationViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Nazwa potwora
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rozmiar potwora
|
||||
/// </summary>
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rodzaj potwora
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Podtyp potwora
|
||||
/// </summary>
|
||||
public string Subtype { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Charakter potwora
|
||||
/// </summary>
|
||||
public string Alignment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Poziom pancerza potwora
|
||||
/// </summary>
|
||||
public int ArmorClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Iloś punktów zycia potwora
|
||||
/// </summary>
|
||||
public int HitPoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ilość kości określajacych punkty życia potwora
|
||||
/// </summary>
|
||||
public int HitDiceAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Kość którą rzucamy aby określić punkty życia potwora
|
||||
/// </summary>
|
||||
public int HitDiceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Szybkość chodzenia potwora
|
||||
/// </summary>
|
||||
public string WalkSpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Szybkość pływania potwora
|
||||
/// </summary>
|
||||
public string SwimSpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Szybkość latania potwora
|
||||
/// </summary>
|
||||
public string FlySpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty zręczności potwora
|
||||
/// </summary>
|
||||
public int Dexterity { get; set; }
|
||||
public int? DexteritySave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty siły potwora
|
||||
/// </summary>
|
||||
public int Strength { get; set; }
|
||||
public int? StrengthSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty kondycji potwora
|
||||
/// </summary>
|
||||
public int Constitution { get; set; }
|
||||
public int? ConstitutionSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty inteligencji potwora
|
||||
/// </summary>
|
||||
public int Intelligence { get; set; }
|
||||
public int? IntelligenceSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty mądrości potwora
|
||||
/// </summary>
|
||||
public int Wisdom { get; set; }
|
||||
public int? WisdomSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty charyzmy potwora
|
||||
/// </summary>
|
||||
public int Charisma { get; set; }
|
||||
public int? CharismaSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Poziom trudności potwora
|
||||
/// </summary>
|
||||
public int ChallengeRating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty doświadczenia za zabicie potwora
|
||||
/// </summary>
|
||||
public int ExperiencePoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na jakie stany odporny jest potwor
|
||||
/// </summary>
|
||||
public string MonsterConditionImmunities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na jakie obrazenia odporny jest potwor
|
||||
/// </summary>
|
||||
public string MonsterDamageImmunities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na jakie obrazenia potwor ma zmniejszoną słabosc
|
||||
/// </summary>
|
||||
public string MonsterDamageResistances { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na co potwor jest wrazliwy
|
||||
/// </summary>
|
||||
public string MonsterDamageVulnerabilities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Jezyki jakimi wlada potwor
|
||||
/// </summary>
|
||||
public string MonsterLanguages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Połączenie z tabelą MonsterSenses
|
||||
/// </summary>
|
||||
public string MonsterSenses { get; set; }
|
||||
|
||||
public ICollection<GameActionViewModel> MonsterGameActions { get; set; }
|
||||
|
||||
public ICollection<LegendaryActionViewModel> MonsteLegendaryActions { get; set; }
|
||||
|
||||
public ICollection<SpecialAbilityViewModel> MonsterSpecialAbilities { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.MonsterViewModels
|
||||
{
|
||||
public class MonsterViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Nazwa potwora
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rozmiar potwora
|
||||
/// </summary>
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Rodzaj potwora
|
||||
/// </summary>
|
||||
public string Type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Podtyp potwora
|
||||
/// </summary>
|
||||
public string Subtype { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Charakter potwora
|
||||
/// </summary>
|
||||
public string Alignment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Poziom pancerza potwora
|
||||
/// </summary>
|
||||
public int ArmorClass { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Iloś punktów zycia potwora
|
||||
/// </summary>
|
||||
public int HitPoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Ilość kości określajacych punkty życia potwora
|
||||
/// </summary>
|
||||
public int HitDiceAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Kość którą rzucamy aby określić punkty życia potwora
|
||||
/// </summary>
|
||||
public int HitDiceType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Szybkość chodzenia potwora
|
||||
/// </summary>
|
||||
public string WalkSpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Szybkość pływania potwora
|
||||
/// </summary>
|
||||
public string SwimSpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Szybkość latania potwora
|
||||
/// </summary>
|
||||
public string FlySpeed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty zręczności potwora
|
||||
/// </summary>
|
||||
public int Dexterity { get; set; }
|
||||
public int? DexteritySave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty siły potwora
|
||||
/// </summary>
|
||||
public int Strength { get; set; }
|
||||
public int? StrengthSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty kondycji potwora
|
||||
/// </summary>
|
||||
public int Constitution { get; set; }
|
||||
public int? ConstitutionSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty inteligencji potwora
|
||||
/// </summary>
|
||||
public int Intelligence { get; set; }
|
||||
public int? IntelligenceSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty mądrości potwora
|
||||
/// </summary>
|
||||
public int Wisdom { get; set; }
|
||||
public int? WisdomSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty charyzmy potwora
|
||||
/// </summary>
|
||||
public int Charisma { get; set; }
|
||||
public int? CharismaSave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Poziom trudności potwora
|
||||
/// </summary>
|
||||
public int ChallengeRating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Punkty doświadczenia za zabicie potwora
|
||||
/// </summary>
|
||||
public int ExperiencePoints { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na jakie stany odporny jest potwor
|
||||
/// </summary>
|
||||
public string MonsterConditionImmunities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na jakie obrazenia odporny jest potwor
|
||||
/// </summary>
|
||||
public string MonsterDamageImmunities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na jakie obrazenia potwor ma zmniejszoną słabosc
|
||||
/// </summary>
|
||||
public string MonsterDamageResistances { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Na co potwor jest wrazliwy
|
||||
/// </summary>
|
||||
public string MonsterDamageVulnerabilities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Jezyki jakimi wlada potwor
|
||||
/// </summary>
|
||||
public string MonsterLanguages { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Połączenie z tabelą MonsterSenses
|
||||
/// </summary>
|
||||
public string MonsterSenses { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace SessionCompanion.ViewModels.SpecialAbilityViewModels
|
||||
{
|
||||
public class SpecialAbilityViewModel
|
||||
{
|
||||
public int Id { get; set; }
|
||||
// <summary>
|
||||
/// Nazwa umiejętności
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Opis umiejętności
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
|
||||
public int? DamageDice { get; set; }
|
||||
|
||||
public int? DamageDiceAmount { get; set; }
|
||||
}
|
||||
}
|
@ -36,6 +36,13 @@ namespace SessionCompanion.Configurations
|
||||
services.AddScoped<IRepository<CharacterOtherEquipment>, CharacterOtherEquipmentRepository>();
|
||||
services.AddScoped<IRepository<Weapon>, WeaponRepository>();
|
||||
services.AddScoped<IRepository<CharacterWeapon>, CharacterWeaponRepository>();
|
||||
services.AddScoped<IRepository<GameAction>, GameActionRepository>();
|
||||
services.AddScoped<IRepository<LegendaryAction>, LegendaryActionRepository>();
|
||||
services.AddScoped<IRepository<MonsterAction>, MonsterActionsRepository>();
|
||||
services.AddScoped<IRepository<MonsterLegendaryAction>, MonsterLegendaryActionsRepository>();
|
||||
services.AddScoped<IRepository<Monster>, MonsterRepository>();
|
||||
services.AddScoped<IRepository<MonsterSpecialAbility>, MonsterSpecialAbilitiesRepository>();
|
||||
services.AddScoped<IRepository<SpecialAbility>, SpecialAbilityRepository>();
|
||||
return services;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user