Merge pull request 'SES-143 Add Monster Table' (#69) from SES-143 into dev

Reviewed-on: #69
This commit is contained in:
Łukasz Góreczny 2021-01-13 09:22:48 +01:00
commit 19c7a08703
24 changed files with 837 additions and 0 deletions

View File

@ -127,3 +127,4 @@ namespace SessionCompanion.Database
}
}
}

View File

@ -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)
{ }
}
}

View File

@ -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)
{ }
}
}

View File

@ -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)
{ }
}
}

View File

@ -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)
{ }
}
}

View File

@ -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)
{ }
}
}

View File

@ -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)
{ }
}
}

View File

@ -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)
{ }
}
}

View File

@ -0,0 +1,30 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class GameAction : BaseEntity
{
// <summary>
/// Nazwa akcji
/// </summary>
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; }
public virtual ICollection<MonsterAction> MonsterActions { get; set; }
}
}

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class LegendaryAction : BaseEntity
{
// <summary>
/// Nazwa legendarnej akcji
/// </summary>
public string Name { get; set; }
/// <summary>
/// Opis akcji
/// </summary>
public string Description { get; set; }
public virtual ICollection<MonsterLegendaryAction> MonsterLegendaryActions { get; set; }
}
}

View File

@ -0,0 +1,162 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class Monster : BaseEntity
{
/// <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>
/// Połączenie z tabelą MonsterActions
/// </summary>
public virtual ICollection<MonsterAction> MonsterAction { 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ą MonsterLegendaryActions
/// </summary>
public virtual ICollection<MonsterLegendaryAction> MonsterLegendaryAction { get; set; }
/// <summary>
/// Połączenie z tabelą MonsterSenses
/// </summary>
public string MonsterSenses { get; set; }
/// <summary>
/// Połączenie z tabelą MonsterSpecialAbilities
/// </summary>
public virtual ICollection<MonsterSpecialAbility> MonsterSpecialAbility { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class MonsterAction : BaseEntity
{
/// <summary>
/// Id potwora
/// </summary>
public int MonsterId { get; set; }
/// <summary>
/// Połączenie z tabelą Monsters
/// </summary>
public virtual Monster Monster { get; set; }
public int GameActionId { get; set; }
public virtual GameAction GameAction { get; set; }
}
}

View File

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class MonsterLegendaryAction : BaseEntity
{
/// <summary>
/// Id potwora
/// </summary>
public int MonsterId { get; set; }
public int LegendaryActionId { get; set; }
/// <summary>
/// Połączenie z tabelą Monster
/// </summary>
public virtual Monster Monster { get; set; }
public virtual LegendaryAction LegendaryActions { get; set; }
}
}

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class MonsterSpecialAbility : BaseEntity
{
public int SpecialAbilityId { get; set; }
public int? DamageDice { get; set; }
public int? DamageDiceAmount { get; set; }
/// <summary>
/// Id potwora
/// </summary>
public int? MonsterId { get; set; }
public virtual SpecialAbility SpecialAbility { get; set; }
/// <summary>
/// Połączenie z tabelą Monster
/// </summary>
public virtual Monster Monster { get; set; }
}
}

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Database.Tables
{
public class SpecialAbility : BaseEntity
{
// <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; }
public virtual ICollection<MonsterSpecialAbility> MonsterSpecialAbilities { get; set; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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; }
}
}

View File

@ -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;
}
}