not working inventory :c

This commit is contained in:
2025-02-04 17:47:18 -03:00
parent f234b5d84d
commit 7a2c3d2f67
22 changed files with 2713 additions and 49 deletions

View File

@@ -0,0 +1,677 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PetCompanion.Data;
#nullable disable
namespace PetCompanion.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("20250202234056_InitialCreate")]
partial class InitialCreate
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.1");
modelBuilder.Entity("PetCompanion.Models.EquippedItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("EquipTarget")
.HasColumnType("INTEGER");
b.Property<int>("GameItemId")
.HasColumnType("INTEGER");
b.Property<string>("PetId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("GameItemId");
b.HasIndex("PetId");
b.ToTable("EquippedItems");
});
modelBuilder.Entity("PetCompanion.Models.GameItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Effect")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("EquipTarget")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Price")
.HasColumnType("INTEGER");
b.Property<int>("Rarity")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("GameItems");
});
modelBuilder.Entity("PetCompanion.Models.Inventory", b =>
{
b.Property<string>("PetId")
.HasColumnType("TEXT");
b.Property<int>("Capacity")
.HasColumnType("INTEGER");
b.HasKey("PetId");
b.ToTable("Inventories");
});
modelBuilder.Entity("PetCompanion.Models.InventoryItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("GameItemId")
.HasColumnType("INTEGER");
b.Property<string>("InventoryId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Quantity")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("GameItemId");
b.HasIndex("InventoryId");
b.ToTable("InventoryItems");
});
modelBuilder.Entity("PetCompanion.Models.Pet", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<DateTime>("BasicActionCooldown")
.HasColumnType("TEXT");
b.Property<int>("Class")
.HasColumnType("INTEGER");
b.Property<int>("Experience")
.HasColumnType("INTEGER");
b.Property<DateTime>("GatherActionSince")
.HasColumnType("TEXT");
b.Property<int>("Health")
.HasColumnType("INTEGER");
b.Property<bool>("IsDead")
.HasColumnType("INTEGER");
b.Property<int>("Level")
.HasColumnType("INTEGER");
b.Property<int>("MaxHealth")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("PetBasicAction")
.HasColumnType("INTEGER");
b.Property<int>("PetGatherAction")
.HasColumnType("INTEGER");
b.Property<int>("SkillPoints")
.HasColumnType("INTEGER");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Pets");
});
modelBuilder.Entity("PetCompanion.Models.PetSkill", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("CurrentTier")
.HasColumnType("INTEGER");
b.Property<string>("PetId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("SkillId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("PetId");
b.HasIndex("SkillId");
b.ToTable("PetSkills");
});
modelBuilder.Entity("PetCompanion.Models.PetStats", b =>
{
b.Property<string>("PetId")
.HasColumnType("TEXT");
b.Property<int>("Agility")
.HasColumnType("INTEGER");
b.Property<int>("Charisma")
.HasColumnType("INTEGER");
b.Property<int>("Intelligence")
.HasColumnType("INTEGER");
b.Property<int>("Luck")
.HasColumnType("INTEGER");
b.Property<int>("MaxCharisma")
.HasColumnType("INTEGER");
b.Property<int>("MaxIntelligence")
.HasColumnType("INTEGER");
b.Property<int>("MaxStrength")
.HasColumnType("INTEGER");
b.Property<int>("Perception")
.HasColumnType("INTEGER");
b.Property<int>("Strength")
.HasColumnType("INTEGER");
b.HasKey("PetId");
b.ToTable("PetStats");
});
modelBuilder.Entity("PetCompanion.Models.Resources", b =>
{
b.Property<string>("PetId")
.HasColumnType("TEXT");
b.Property<int>("Food")
.HasColumnType("INTEGER");
b.Property<int>("Gold")
.HasColumnType("INTEGER");
b.Property<int>("Junk")
.HasColumnType("INTEGER");
b.Property<int>("Wisdom")
.HasColumnType("INTEGER");
b.HasKey("PetId");
b.ToTable("Resources");
});
modelBuilder.Entity("PetCompanion.Models.Skill", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("PointsCost")
.HasColumnType("INTEGER");
b.PrimitiveCollection<string>("SkillsIdRequired")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Skills");
b.HasData(
new
{
Id = 1,
Description = "Increases maximum health of your pet, making it more resilient.",
Icon = "❤",
Name = "Vitality Mastery",
PointsCost = 1,
Type = 0
},
new
{
Id = 2,
Description = "Increases maximum intelligence of your pet, improving its learning capabilities.",
Icon = "🧠",
Name = "Mind Enhancement",
PointsCost = 1,
Type = 0
},
new
{
Id = 3,
Description = "Increases maximum strength of your pet, making it more powerful.",
Icon = "💪",
Name = "Strength Training",
PointsCost = 1,
Type = 0
},
new
{
Id = 4,
Description = "Increases maximum charisma of your pet, making it more charming.",
Icon = "🎭",
Name = "Charisma Boost",
PointsCost = 1,
Type = 0
},
new
{
Id = 5,
Description = "Increases luck of your pet, making it more fortunate to find rare items.",
Icon = "🍀",
Name = "Luck of the Draw",
PointsCost = 1,
SkillsIdRequired = "[4]",
Type = 0
},
new
{
Id = 6,
Description = "Increases agility of your pet, making it faster in combat.",
Icon = "🏃",
Name = "Agility Training",
PointsCost = 1,
SkillsIdRequired = "[3]",
Type = 0
},
new
{
Id = 7,
Description = "Increases perception of your pet, making it more aware of its surroundings.",
Icon = "👀",
Name = "Perception Boost",
PointsCost = 1,
SkillsIdRequired = "[2]",
Type = 0
});
});
modelBuilder.Entity("PetCompanion.Models.SkillEffect", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Effect")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("SkillId")
.HasColumnType("INTEGER");
b.Property<int>("Tier")
.HasColumnType("INTEGER");
b.Property<decimal>("Value")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SkillId");
b.ToTable("SkillEffects");
b.HasData(
new
{
Id = 1,
Effect = "MaxHealth",
SkillId = 1,
Tier = 1,
Value = 25m
},
new
{
Id = 2,
Effect = "MaxHealth",
SkillId = 1,
Tier = 2,
Value = 50m
},
new
{
Id = 3,
Effect = "MaxHealth",
SkillId = 1,
Tier = 3,
Value = 100m
},
new
{
Id = 4,
Effect = "MaxIntelligence",
SkillId = 2,
Tier = 1,
Value = 5m
},
new
{
Id = 5,
Effect = "MaxIntelligence",
SkillId = 2,
Tier = 2,
Value = 10m
},
new
{
Id = 6,
Effect = "MaxIntelligence",
SkillId = 2,
Tier = 3,
Value = 20m
},
new
{
Id = 7,
Effect = "MaxStrength",
SkillId = 3,
Tier = 1,
Value = 5m
},
new
{
Id = 8,
Effect = "MaxStrength",
SkillId = 3,
Tier = 2,
Value = 10m
},
new
{
Id = 9,
Effect = "MaxStrength",
SkillId = 3,
Tier = 3,
Value = 20m
},
new
{
Id = 10,
Effect = "MaxCharisma",
SkillId = 4,
Tier = 1,
Value = 5m
},
new
{
Id = 11,
Effect = "MaxCharisma",
SkillId = 4,
Tier = 2,
Value = 10m
},
new
{
Id = 12,
Effect = "MaxCharisma",
SkillId = 4,
Tier = 3,
Value = 20m
},
new
{
Id = 13,
Effect = "Luck",
SkillId = 5,
Tier = 1,
Value = 1m
},
new
{
Id = 14,
Effect = "Luck",
SkillId = 5,
Tier = 2,
Value = 2m
},
new
{
Id = 15,
Effect = "Luck",
SkillId = 5,
Tier = 3,
Value = 3m
},
new
{
Id = 16,
Effect = "Agility",
SkillId = 6,
Tier = 1,
Value = 1m
},
new
{
Id = 17,
Effect = "Agility",
SkillId = 6,
Tier = 2,
Value = 2m
},
new
{
Id = 18,
Effect = "Agility",
SkillId = 6,
Tier = 3,
Value = 3m
},
new
{
Id = 19,
Effect = "Perception",
SkillId = 7,
Tier = 1,
Value = 1m
},
new
{
Id = 20,
Effect = "Perception",
SkillId = 7,
Tier = 2,
Value = 2m
},
new
{
Id = 21,
Effect = "Perception",
SkillId = 7,
Tier = 3,
Value = 3m
});
});
modelBuilder.Entity("PetCompanion.Models.EquippedItem", b =>
{
b.HasOne("PetCompanion.Models.GameItem", "GameItem")
.WithMany()
.HasForeignKey("GameItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithMany("EquippedItemsList")
.HasForeignKey("PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GameItem");
b.Navigation("Pet");
});
modelBuilder.Entity("PetCompanion.Models.Inventory", b =>
{
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithOne("Inventory")
.HasForeignKey("PetCompanion.Models.Inventory", "PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Pet");
});
modelBuilder.Entity("PetCompanion.Models.InventoryItem", b =>
{
b.HasOne("PetCompanion.Models.GameItem", "GameItem")
.WithMany()
.HasForeignKey("GameItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PetCompanion.Models.Inventory", null)
.WithMany("Items")
.HasForeignKey("InventoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GameItem");
});
modelBuilder.Entity("PetCompanion.Models.PetSkill", b =>
{
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithMany("Skills")
.HasForeignKey("PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PetCompanion.Models.Skill", "Skill")
.WithMany("PetSkills")
.HasForeignKey("SkillId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Pet");
b.Navigation("Skill");
});
modelBuilder.Entity("PetCompanion.Models.PetStats", b =>
{
b.HasOne("PetCompanion.Models.Pet", null)
.WithOne("Stats")
.HasForeignKey("PetCompanion.Models.PetStats", "PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PetCompanion.Models.Resources", b =>
{
b.HasOne("PetCompanion.Models.Pet", null)
.WithOne("Resources")
.HasForeignKey("PetCompanion.Models.Resources", "PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PetCompanion.Models.SkillEffect", b =>
{
b.HasOne("PetCompanion.Models.Skill", "Skill")
.WithMany("Effects")
.HasForeignKey("SkillId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Skill");
});
modelBuilder.Entity("PetCompanion.Models.Inventory", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("PetCompanion.Models.Pet", b =>
{
b.Navigation("EquippedItemsList");
b.Navigation("Inventory")
.IsRequired();
b.Navigation("Resources")
.IsRequired();
b.Navigation("Skills");
b.Navigation("Stats")
.IsRequired();
});
modelBuilder.Entity("PetCompanion.Models.Skill", b =>
{
b.Navigation("Effects");
b.Navigation("PetSkills");
});
#pragma warning restore 612, 618
}
}
}

View File

@@ -0,0 +1,357 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional
namespace PetCompanion.Migrations
{
/// <inheritdoc />
public partial class InitialCreate : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "GameItems",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
Rarity = table.Column<int>(type: "INTEGER", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Price = table.Column<int>(type: "INTEGER", nullable: false),
Effect = table.Column<string>(type: "TEXT", nullable: false),
EquipTarget = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GameItems", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Pets",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
Class = table.Column<int>(type: "INTEGER", nullable: false),
Level = table.Column<int>(type: "INTEGER", nullable: false),
Experience = table.Column<int>(type: "INTEGER", nullable: false),
Health = table.Column<int>(type: "INTEGER", nullable: false),
MaxHealth = table.Column<int>(type: "INTEGER", nullable: false),
UserId = table.Column<string>(type: "TEXT", nullable: false),
IsDead = table.Column<bool>(type: "INTEGER", nullable: false),
PetGatherAction = table.Column<int>(type: "INTEGER", nullable: false),
GatherActionSince = table.Column<DateTime>(type: "TEXT", nullable: false),
PetBasicAction = table.Column<int>(type: "INTEGER", nullable: false),
BasicActionCooldown = table.Column<DateTime>(type: "TEXT", nullable: false),
SkillPoints = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Pets", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Skills",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
Name = table.Column<string>(type: "TEXT", nullable: false),
Description = table.Column<string>(type: "TEXT", nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
PointsCost = table.Column<int>(type: "INTEGER", nullable: false),
Icon = table.Column<string>(type: "TEXT", nullable: false),
SkillsIdRequired = table.Column<string>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Skills", x => x.Id);
});
migrationBuilder.CreateTable(
name: "EquippedItems",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
PetId = table.Column<string>(type: "TEXT", nullable: false),
EquipTarget = table.Column<int>(type: "INTEGER", nullable: false),
GameItemId = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EquippedItems", x => x.Id);
table.ForeignKey(
name: "FK_EquippedItems_GameItems_GameItemId",
column: x => x.GameItemId,
principalTable: "GameItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_EquippedItems_Pets_PetId",
column: x => x.PetId,
principalTable: "Pets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Inventories",
columns: table => new
{
PetId = table.Column<string>(type: "TEXT", nullable: false),
Capacity = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Inventories", x => x.PetId);
table.ForeignKey(
name: "FK_Inventories_Pets_PetId",
column: x => x.PetId,
principalTable: "Pets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PetStats",
columns: table => new
{
PetId = table.Column<string>(type: "TEXT", nullable: false),
Intelligence = table.Column<int>(type: "INTEGER", nullable: false),
Strength = table.Column<int>(type: "INTEGER", nullable: false),
Charisma = table.Column<int>(type: "INTEGER", nullable: false),
Luck = table.Column<int>(type: "INTEGER", nullable: false),
Agility = table.Column<int>(type: "INTEGER", nullable: false),
Perception = table.Column<int>(type: "INTEGER", nullable: false),
MaxIntelligence = table.Column<int>(type: "INTEGER", nullable: false),
MaxStrength = table.Column<int>(type: "INTEGER", nullable: false),
MaxCharisma = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PetStats", x => x.PetId);
table.ForeignKey(
name: "FK_PetStats_Pets_PetId",
column: x => x.PetId,
principalTable: "Pets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Resources",
columns: table => new
{
PetId = table.Column<string>(type: "TEXT", nullable: false),
Wisdom = table.Column<int>(type: "INTEGER", nullable: false),
Gold = table.Column<int>(type: "INTEGER", nullable: false),
Food = table.Column<int>(type: "INTEGER", nullable: false),
Junk = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Resources", x => x.PetId);
table.ForeignKey(
name: "FK_Resources_Pets_PetId",
column: x => x.PetId,
principalTable: "Pets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "PetSkills",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
PetId = table.Column<string>(type: "TEXT", nullable: false),
SkillId = table.Column<int>(type: "INTEGER", nullable: false),
CurrentTier = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PetSkills", x => x.Id);
table.ForeignKey(
name: "FK_PetSkills_Pets_PetId",
column: x => x.PetId,
principalTable: "Pets",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_PetSkills_Skills_SkillId",
column: x => x.SkillId,
principalTable: "Skills",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "SkillEffects",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
SkillId = table.Column<int>(type: "INTEGER", nullable: false),
Tier = table.Column<int>(type: "INTEGER", nullable: false),
Effect = table.Column<string>(type: "TEXT", nullable: false),
Value = table.Column<decimal>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SkillEffects", x => x.Id);
table.ForeignKey(
name: "FK_SkillEffects_Skills_SkillId",
column: x => x.SkillId,
principalTable: "Skills",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "InventoryItems",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
InventoryId = table.Column<string>(type: "TEXT", nullable: false),
GameItemId = table.Column<int>(type: "INTEGER", nullable: false),
Quantity = table.Column<int>(type: "INTEGER", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_InventoryItems", x => x.Id);
table.ForeignKey(
name: "FK_InventoryItems_GameItems_GameItemId",
column: x => x.GameItemId,
principalTable: "GameItems",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_InventoryItems_Inventories_InventoryId",
column: x => x.InventoryId,
principalTable: "Inventories",
principalColumn: "PetId",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.InsertData(
table: "Skills",
columns: new[] { "Id", "Description", "Icon", "Name", "PointsCost", "SkillsIdRequired", "Type" },
values: new object[,]
{
{ 1, "Increases maximum health of your pet, making it more resilient.", "❤", "Vitality Mastery", 1, null, 0 },
{ 2, "Increases maximum intelligence of your pet, improving its learning capabilities.", "🧠", "Mind Enhancement", 1, null, 0 },
{ 3, "Increases maximum strength of your pet, making it more powerful.", "💪", "Strength Training", 1, null, 0 },
{ 4, "Increases maximum charisma of your pet, making it more charming.", "🎭", "Charisma Boost", 1, null, 0 },
{ 5, "Increases luck of your pet, making it more fortunate to find rare items.", "🍀", "Luck of the Draw", 1, "[4]", 0 },
{ 6, "Increases agility of your pet, making it faster in combat.", "🏃", "Agility Training", 1, "[3]", 0 },
{ 7, "Increases perception of your pet, making it more aware of its surroundings.", "👀", "Perception Boost", 1, "[2]", 0 }
});
migrationBuilder.InsertData(
table: "SkillEffects",
columns: new[] { "Id", "Effect", "SkillId", "Tier", "Value" },
values: new object[,]
{
{ 1, "MaxHealth", 1, 1, 25m },
{ 2, "MaxHealth", 1, 2, 50m },
{ 3, "MaxHealth", 1, 3, 100m },
{ 4, "MaxIntelligence", 2, 1, 5m },
{ 5, "MaxIntelligence", 2, 2, 10m },
{ 6, "MaxIntelligence", 2, 3, 20m },
{ 7, "MaxStrength", 3, 1, 5m },
{ 8, "MaxStrength", 3, 2, 10m },
{ 9, "MaxStrength", 3, 3, 20m },
{ 10, "MaxCharisma", 4, 1, 5m },
{ 11, "MaxCharisma", 4, 2, 10m },
{ 12, "MaxCharisma", 4, 3, 20m },
{ 13, "Luck", 5, 1, 1m },
{ 14, "Luck", 5, 2, 2m },
{ 15, "Luck", 5, 3, 3m },
{ 16, "Agility", 6, 1, 1m },
{ 17, "Agility", 6, 2, 2m },
{ 18, "Agility", 6, 3, 3m },
{ 19, "Perception", 7, 1, 1m },
{ 20, "Perception", 7, 2, 2m },
{ 21, "Perception", 7, 3, 3m }
});
migrationBuilder.CreateIndex(
name: "IX_EquippedItems_GameItemId",
table: "EquippedItems",
column: "GameItemId");
migrationBuilder.CreateIndex(
name: "IX_EquippedItems_PetId",
table: "EquippedItems",
column: "PetId");
migrationBuilder.CreateIndex(
name: "IX_InventoryItems_GameItemId",
table: "InventoryItems",
column: "GameItemId");
migrationBuilder.CreateIndex(
name: "IX_InventoryItems_InventoryId",
table: "InventoryItems",
column: "InventoryId");
migrationBuilder.CreateIndex(
name: "IX_PetSkills_PetId",
table: "PetSkills",
column: "PetId");
migrationBuilder.CreateIndex(
name: "IX_PetSkills_SkillId",
table: "PetSkills",
column: "SkillId");
migrationBuilder.CreateIndex(
name: "IX_SkillEffects_SkillId",
table: "SkillEffects",
column: "SkillId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "EquippedItems");
migrationBuilder.DropTable(
name: "InventoryItems");
migrationBuilder.DropTable(
name: "PetSkills");
migrationBuilder.DropTable(
name: "PetStats");
migrationBuilder.DropTable(
name: "Resources");
migrationBuilder.DropTable(
name: "SkillEffects");
migrationBuilder.DropTable(
name: "GameItems");
migrationBuilder.DropTable(
name: "Inventories");
migrationBuilder.DropTable(
name: "Skills");
migrationBuilder.DropTable(
name: "Pets");
}
}
}

View File

@@ -0,0 +1,674 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PetCompanion.Data;
#nullable disable
namespace PetCompanion.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "9.0.1");
modelBuilder.Entity("PetCompanion.Models.EquippedItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("EquipTarget")
.HasColumnType("INTEGER");
b.Property<int>("GameItemId")
.HasColumnType("INTEGER");
b.Property<string>("PetId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("GameItemId");
b.HasIndex("PetId");
b.ToTable("EquippedItems");
});
modelBuilder.Entity("PetCompanion.Models.GameItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Effect")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("EquipTarget")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Price")
.HasColumnType("INTEGER");
b.Property<int>("Rarity")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("GameItems");
});
modelBuilder.Entity("PetCompanion.Models.Inventory", b =>
{
b.Property<string>("PetId")
.HasColumnType("TEXT");
b.Property<int>("Capacity")
.HasColumnType("INTEGER");
b.HasKey("PetId");
b.ToTable("Inventories");
});
modelBuilder.Entity("PetCompanion.Models.InventoryItem", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("GameItemId")
.HasColumnType("INTEGER");
b.Property<string>("InventoryId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Quantity")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("GameItemId");
b.HasIndex("InventoryId");
b.ToTable("InventoryItems");
});
modelBuilder.Entity("PetCompanion.Models.Pet", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
b.Property<DateTime>("BasicActionCooldown")
.HasColumnType("TEXT");
b.Property<int>("Class")
.HasColumnType("INTEGER");
b.Property<int>("Experience")
.HasColumnType("INTEGER");
b.Property<DateTime>("GatherActionSince")
.HasColumnType("TEXT");
b.Property<int>("Health")
.HasColumnType("INTEGER");
b.Property<bool>("IsDead")
.HasColumnType("INTEGER");
b.Property<int>("Level")
.HasColumnType("INTEGER");
b.Property<int>("MaxHealth")
.HasColumnType("INTEGER");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("PetBasicAction")
.HasColumnType("INTEGER");
b.Property<int>("PetGatherAction")
.HasColumnType("INTEGER");
b.Property<int>("SkillPoints")
.HasColumnType("INTEGER");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");
b.ToTable("Pets");
});
modelBuilder.Entity("PetCompanion.Models.PetSkill", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<int>("CurrentTier")
.HasColumnType("INTEGER");
b.Property<string>("PetId")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("SkillId")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("PetId");
b.HasIndex("SkillId");
b.ToTable("PetSkills");
});
modelBuilder.Entity("PetCompanion.Models.PetStats", b =>
{
b.Property<string>("PetId")
.HasColumnType("TEXT");
b.Property<int>("Agility")
.HasColumnType("INTEGER");
b.Property<int>("Charisma")
.HasColumnType("INTEGER");
b.Property<int>("Intelligence")
.HasColumnType("INTEGER");
b.Property<int>("Luck")
.HasColumnType("INTEGER");
b.Property<int>("MaxCharisma")
.HasColumnType("INTEGER");
b.Property<int>("MaxIntelligence")
.HasColumnType("INTEGER");
b.Property<int>("MaxStrength")
.HasColumnType("INTEGER");
b.Property<int>("Perception")
.HasColumnType("INTEGER");
b.Property<int>("Strength")
.HasColumnType("INTEGER");
b.HasKey("PetId");
b.ToTable("PetStats");
});
modelBuilder.Entity("PetCompanion.Models.Resources", b =>
{
b.Property<string>("PetId")
.HasColumnType("TEXT");
b.Property<int>("Food")
.HasColumnType("INTEGER");
b.Property<int>("Gold")
.HasColumnType("INTEGER");
b.Property<int>("Junk")
.HasColumnType("INTEGER");
b.Property<int>("Wisdom")
.HasColumnType("INTEGER");
b.HasKey("PetId");
b.ToTable("Resources");
});
modelBuilder.Entity("PetCompanion.Models.Skill", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Icon")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("PointsCost")
.HasColumnType("INTEGER");
b.PrimitiveCollection<string>("SkillsIdRequired")
.HasColumnType("TEXT");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.ToTable("Skills");
b.HasData(
new
{
Id = 1,
Description = "Increases maximum health of your pet, making it more resilient.",
Icon = "❤",
Name = "Vitality Mastery",
PointsCost = 1,
Type = 0
},
new
{
Id = 2,
Description = "Increases maximum intelligence of your pet, improving its learning capabilities.",
Icon = "🧠",
Name = "Mind Enhancement",
PointsCost = 1,
Type = 0
},
new
{
Id = 3,
Description = "Increases maximum strength of your pet, making it more powerful.",
Icon = "💪",
Name = "Strength Training",
PointsCost = 1,
Type = 0
},
new
{
Id = 4,
Description = "Increases maximum charisma of your pet, making it more charming.",
Icon = "🎭",
Name = "Charisma Boost",
PointsCost = 1,
Type = 0
},
new
{
Id = 5,
Description = "Increases luck of your pet, making it more fortunate to find rare items.",
Icon = "🍀",
Name = "Luck of the Draw",
PointsCost = 1,
SkillsIdRequired = "[4]",
Type = 0
},
new
{
Id = 6,
Description = "Increases agility of your pet, making it faster in combat.",
Icon = "🏃",
Name = "Agility Training",
PointsCost = 1,
SkillsIdRequired = "[3]",
Type = 0
},
new
{
Id = 7,
Description = "Increases perception of your pet, making it more aware of its surroundings.",
Icon = "👀",
Name = "Perception Boost",
PointsCost = 1,
SkillsIdRequired = "[2]",
Type = 0
});
});
modelBuilder.Entity("PetCompanion.Models.SkillEffect", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
b.Property<string>("Effect")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("SkillId")
.HasColumnType("INTEGER");
b.Property<int>("Tier")
.HasColumnType("INTEGER");
b.Property<decimal>("Value")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("SkillId");
b.ToTable("SkillEffects");
b.HasData(
new
{
Id = 1,
Effect = "MaxHealth",
SkillId = 1,
Tier = 1,
Value = 25m
},
new
{
Id = 2,
Effect = "MaxHealth",
SkillId = 1,
Tier = 2,
Value = 50m
},
new
{
Id = 3,
Effect = "MaxHealth",
SkillId = 1,
Tier = 3,
Value = 100m
},
new
{
Id = 4,
Effect = "MaxIntelligence",
SkillId = 2,
Tier = 1,
Value = 5m
},
new
{
Id = 5,
Effect = "MaxIntelligence",
SkillId = 2,
Tier = 2,
Value = 10m
},
new
{
Id = 6,
Effect = "MaxIntelligence",
SkillId = 2,
Tier = 3,
Value = 20m
},
new
{
Id = 7,
Effect = "MaxStrength",
SkillId = 3,
Tier = 1,
Value = 5m
},
new
{
Id = 8,
Effect = "MaxStrength",
SkillId = 3,
Tier = 2,
Value = 10m
},
new
{
Id = 9,
Effect = "MaxStrength",
SkillId = 3,
Tier = 3,
Value = 20m
},
new
{
Id = 10,
Effect = "MaxCharisma",
SkillId = 4,
Tier = 1,
Value = 5m
},
new
{
Id = 11,
Effect = "MaxCharisma",
SkillId = 4,
Tier = 2,
Value = 10m
},
new
{
Id = 12,
Effect = "MaxCharisma",
SkillId = 4,
Tier = 3,
Value = 20m
},
new
{
Id = 13,
Effect = "Luck",
SkillId = 5,
Tier = 1,
Value = 1m
},
new
{
Id = 14,
Effect = "Luck",
SkillId = 5,
Tier = 2,
Value = 2m
},
new
{
Id = 15,
Effect = "Luck",
SkillId = 5,
Tier = 3,
Value = 3m
},
new
{
Id = 16,
Effect = "Agility",
SkillId = 6,
Tier = 1,
Value = 1m
},
new
{
Id = 17,
Effect = "Agility",
SkillId = 6,
Tier = 2,
Value = 2m
},
new
{
Id = 18,
Effect = "Agility",
SkillId = 6,
Tier = 3,
Value = 3m
},
new
{
Id = 19,
Effect = "Perception",
SkillId = 7,
Tier = 1,
Value = 1m
},
new
{
Id = 20,
Effect = "Perception",
SkillId = 7,
Tier = 2,
Value = 2m
},
new
{
Id = 21,
Effect = "Perception",
SkillId = 7,
Tier = 3,
Value = 3m
});
});
modelBuilder.Entity("PetCompanion.Models.EquippedItem", b =>
{
b.HasOne("PetCompanion.Models.GameItem", "GameItem")
.WithMany()
.HasForeignKey("GameItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithMany("EquippedItemsList")
.HasForeignKey("PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GameItem");
b.Navigation("Pet");
});
modelBuilder.Entity("PetCompanion.Models.Inventory", b =>
{
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithOne("Inventory")
.HasForeignKey("PetCompanion.Models.Inventory", "PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Pet");
});
modelBuilder.Entity("PetCompanion.Models.InventoryItem", b =>
{
b.HasOne("PetCompanion.Models.GameItem", "GameItem")
.WithMany()
.HasForeignKey("GameItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PetCompanion.Models.Inventory", null)
.WithMany("Items")
.HasForeignKey("InventoryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("GameItem");
});
modelBuilder.Entity("PetCompanion.Models.PetSkill", b =>
{
b.HasOne("PetCompanion.Models.Pet", "Pet")
.WithMany("Skills")
.HasForeignKey("PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("PetCompanion.Models.Skill", "Skill")
.WithMany("PetSkills")
.HasForeignKey("SkillId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Pet");
b.Navigation("Skill");
});
modelBuilder.Entity("PetCompanion.Models.PetStats", b =>
{
b.HasOne("PetCompanion.Models.Pet", null)
.WithOne("Stats")
.HasForeignKey("PetCompanion.Models.PetStats", "PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PetCompanion.Models.Resources", b =>
{
b.HasOne("PetCompanion.Models.Pet", null)
.WithOne("Resources")
.HasForeignKey("PetCompanion.Models.Resources", "PetId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("PetCompanion.Models.SkillEffect", b =>
{
b.HasOne("PetCompanion.Models.Skill", "Skill")
.WithMany("Effects")
.HasForeignKey("SkillId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Skill");
});
modelBuilder.Entity("PetCompanion.Models.Inventory", b =>
{
b.Navigation("Items");
});
modelBuilder.Entity("PetCompanion.Models.Pet", b =>
{
b.Navigation("EquippedItemsList");
b.Navigation("Inventory")
.IsRequired();
b.Navigation("Resources")
.IsRequired();
b.Navigation("Skills");
b.Navigation("Stats")
.IsRequired();
});
modelBuilder.Entity("PetCompanion.Models.Skill", b =>
{
b.Navigation("Effects");
b.Navigation("PetSkills");
});
#pragma warning restore 612, 618
}
}
}