diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 22202c3..2719c34 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "husky": { - "version": "0.6.2", + "version": "0.7.1", "commands": [ "husky" ], @@ -17,7 +17,7 @@ "rollForward": false }, "gitversion.tool": { - "version": "5.12.0", + "version": "6.0.5", "commands": [ "dotnet-gitversion" ], diff --git a/Server/Migrations/Initial.cs b/Server/Migrations/Initial.cs index 1cd7aa1..92777b2 100644 --- a/Server/Migrations/Initial.cs +++ b/Server/Migrations/Initial.cs @@ -13,15 +13,14 @@ protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Users", - columns: table => - new - { - Id = table - .Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Username = table.Column(type: "TEXT", nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false) - }, + columns: table => new + { + Id = table + .Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Username = table.Column(type: "TEXT", nullable: false), + CreatedAt = table.Column(type: "TEXT", nullable: false), + }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); @@ -30,20 +29,19 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "Items", - columns: table => - new - { - Id = table - .Column(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column(type: "TEXT", nullable: false), - History = table.Column(type: "TEXT", nullable: true), - Rarity = table.Column(type: "INTEGER", nullable: false), - Type = table.Column(type: "INTEGER", nullable: false), - CreatedAt = table.Column(type: "TEXT", nullable: false), - IsEquipped = table.Column(type: "INTEGER", nullable: false), - CreatedById = table.Column(type: "INTEGER", nullable: false) - }, + columns: table => new + { + Id = table + .Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: false), + History = table.Column(type: "TEXT", nullable: true), + Rarity = table.Column(type: "INTEGER", nullable: false), + Type = table.Column(type: "INTEGER", nullable: false), + CreatedAt = table.Column(type: "TEXT", nullable: false), + IsEquipped = table.Column(type: "INTEGER", nullable: false), + CreatedById = table.Column(type: "INTEGER", nullable: false), + }, constraints: table => { table.PrimaryKey("PK_Items", x => x.Id); @@ -59,15 +57,14 @@ protected override void Up(MigrationBuilder migrationBuilder) migrationBuilder.CreateTable( name: "ItemStatistics", - columns: table => - new - { - ItemId = table.Column(type: "INTEGER", nullable: false), - Luck = table.Column(type: "INTEGER", nullable: false), - Health = table.Column(type: "INTEGER", nullable: false), - Armor = table.Column(type: "INTEGER", nullable: false), - Power = table.Column(type: "INTEGER", nullable: false) - }, + columns: table => new + { + ItemId = table.Column(type: "INTEGER", nullable: false), + Luck = table.Column(type: "INTEGER", nullable: false), + Health = table.Column(type: "INTEGER", nullable: false), + Armor = table.Column(type: "INTEGER", nullable: false), + Power = table.Column(type: "INTEGER", nullable: false), + }, constraints: table => { table.PrimaryKey("PK_ItemStatistics", x => x.ItemId); diff --git a/Server/Modules/Database/ItemsRepository.cs b/Server/Modules/Database/ItemsRepository.cs index de8bb26..420cf02 100644 --- a/Server/Modules/Database/ItemsRepository.cs +++ b/Server/Modules/Database/ItemsRepository.cs @@ -23,8 +23,8 @@ public async Task AddItemAsync(Item item) public async Task GetItemAsync(int id) { - var item = await _dbContext.Items - .Where(i => i.Id == id) + var item = await _dbContext + .Items.Where(i => i.Id == id) .Include(i => i.Statistics) .FirstOrDefaultAsync(); return item; @@ -32,8 +32,8 @@ public async Task AddItemAsync(Item item) public async Task> GetItemsOfUserAsync(int userId) { - var items = await _dbContext.Items - .Where(i => i.CreatedById == userId) + var items = await _dbContext + .Items.Where(i => i.CreatedById == userId) .Include(i => i.Statistics) .ToListAsync(); return items; diff --git a/Server/Modules/Database/UsersRepository.cs b/Server/Modules/Database/UsersRepository.cs index de6697d..d265037 100644 --- a/Server/Modules/Database/UsersRepository.cs +++ b/Server/Modules/Database/UsersRepository.cs @@ -21,8 +21,8 @@ public async Task AddUserAsync(User user) public async Task GetUserAsync(int id) { - var user = await _dbContext.Users - .Where(u => u.Id == id) + var user = await _dbContext + .Users.Where(u => u.Id == id) .Include(u => u.Items) .ThenInclude(i => i.Statistics) .FirstOrDefaultAsync(); @@ -31,8 +31,8 @@ public async Task AddUserAsync(User user) public async Task GetUserAsync(string username) { - var user = await _dbContext.Users - .Where(u => u.Username == username) + var user = await _dbContext + .Users.Where(u => u.Username == username) .Include(u => u.Items) .ThenInclude(i => i.Statistics) .FirstOrDefaultAsync(); diff --git a/Server/Modules/Items/Models/ItemRarity.cs b/Server/Modules/Items/Models/ItemRarity.cs index 9a70f56..c624bb3 100644 --- a/Server/Modules/Items/Models/ItemRarity.cs +++ b/Server/Modules/Items/Models/ItemRarity.cs @@ -9,7 +9,7 @@ public enum ItemRarity Rare, Insane, Epic, - Legendary + Legendary, } } @@ -29,12 +29,11 @@ public static string ToCssClassName(this ItemRarity rarity) ItemRarity.Insane => "--rarity-insane", ItemRarity.Epic => "--rarity-epic", ItemRarity.Legendary => "--rarity-legendary", - _ - => throw new ArgumentOutOfRangeException( - nameof(rarity), - rarity, - $"Rarity '{rarity}' does not have a corresponding CSS class." - ) + _ => throw new ArgumentOutOfRangeException( + nameof(rarity), + rarity, + $"Rarity '{rarity}' does not have a corresponding CSS class." + ), }; } } diff --git a/Server/Modules/Items/Models/ItemStat.cs b/Server/Modules/Items/Models/ItemStat.cs index 642a2bc..c272edb 100644 --- a/Server/Modules/Items/Models/ItemStat.cs +++ b/Server/Modules/Items/Models/ItemStat.cs @@ -5,5 +5,5 @@ public enum ItemStat Luck, Health, Armor, - Power + Power, } diff --git a/Server/Modules/Items/Models/ItemStatistics.cs b/Server/Modules/Items/Models/ItemStatistics.cs index b36ed31..93f9e2b 100644 --- a/Server/Modules/Items/Models/ItemStatistics.cs +++ b/Server/Modules/Items/Models/ItemStatistics.cs @@ -30,7 +30,7 @@ public int GetStatFromItemStat(ItemStat stat) ItemStat.Health => Health, ItemStat.Armor => Armor, ItemStat.Power => Power, - _ => throw new ArgumentOutOfRangeException(nameof(stat), stat, null) + _ => throw new ArgumentOutOfRangeException(nameof(stat), stat, null), }; } diff --git a/Server/Modules/Items/Models/ItemType.cs b/Server/Modules/Items/Models/ItemType.cs index 5af24ee..b3da0b1 100644 --- a/Server/Modules/Items/Models/ItemType.cs +++ b/Server/Modules/Items/Models/ItemType.cs @@ -7,6 +7,6 @@ public enum ItemType Gauntlets, Leggings, Boots, - Ring + Ring, } } diff --git a/Server/Modules/Items/Models/PrefixesGenerator.cs b/Server/Modules/Items/Models/PrefixesGenerator.cs index c3be984..95d5182 100644 --- a/Server/Modules/Items/Models/PrefixesGenerator.cs +++ b/Server/Modules/Items/Models/PrefixesGenerator.cs @@ -1,5 +1,5 @@ -using Fracture.Server.Modules.Shared; -using System; +using System; +using Fracture.Server.Modules.Shared; namespace Fracture.Server.Modules.Items.Models { @@ -16,7 +16,7 @@ public class PrefixesGenerator { "Poisoned", -40 }, { "Toxic", -60 }, { "Cursed", -80 }, - { "Demonic", -100 } + { "Demonic", -100 }, }; private static readonly Dictionary> StatNames = @@ -35,7 +35,7 @@ public class PrefixesGenerator { "Unfortunate", -40 }, { "Clumsy", -60 }, { "Fateful", -80 }, - { "Misfortune-laden", -100 } + { "Misfortune-laden", -100 }, } }, { @@ -51,7 +51,7 @@ public class PrefixesGenerator { "Feeble", -40 }, { "Flimsy", -60 }, { "Fragile", -80 }, - { "Ethereal", -100 } + { "Ethereal", -100 }, } }, { @@ -67,7 +67,7 @@ public class PrefixesGenerator { "Plain", -40 }, { "Rusty", -60 }, { "Unreliable", -80 }, - { "Primitive", -100 } + { "Primitive", -100 }, } }, { @@ -83,7 +83,7 @@ public class PrefixesGenerator { "Dull", -40 }, { "Brittle", -60 }, { "Weak", -80 }, - { "Wasteful", -100 } + { "Wasteful", -100 }, } }, }; diff --git a/Server/Modules/Items/Services/ItemGenerator.cs b/Server/Modules/Items/Services/ItemGenerator.cs index 6cf510d..dd500ba 100644 --- a/Server/Modules/Items/Services/ItemGenerator.cs +++ b/Server/Modules/Items/Services/ItemGenerator.cs @@ -1,9 +1,9 @@ -using Fracture.Server.Modules.AI.Services; +using System.Text.Json; +using Fracture.Server.Modules.AI.Services; using Fracture.Server.Modules.Items.Models; using Fracture.Server.Modules.Shared; using Fracture.Server.Modules.Shared.Configuration; using Microsoft.FeatureManagement; -using System.Text.Json; namespace Fracture.Server.Modules.Items.Services { @@ -54,7 +54,7 @@ private async Task GenerateDescription(Item item) "Tundra", "Swamp", "Savanna", - "Desert" + "Desert", }; List enemies = new List() { @@ -63,7 +63,7 @@ private async Task GenerateDescription(Item item) "Skeleton", "Harpy", "Vampire", - "Knight" + "Knight", }; string biome = biomes[_rnd.Next(biomes.Count)]; diff --git a/Server/Modules/MapGenerator/Services/MapGeneratorService.cs b/Server/Modules/MapGenerator/Services/MapGeneratorService.cs index 2b0fab1..0353c08 100644 --- a/Server/Modules/MapGenerator/Services/MapGeneratorService.cs +++ b/Server/Modules/MapGenerator/Services/MapGeneratorService.cs @@ -1,7 +1,7 @@ -using Fracture.Server.Modules.MapGenerator.Models; +using System.Numerics; +using Fracture.Server.Modules.MapGenerator.Models; using Fracture.Server.Modules.NoiseGenerator.Models; using Fracture.Server.Modules.NoiseGenerator.Services; -using System.Numerics; namespace Fracture.Server.Modules.MapGenerator.Services; diff --git a/Server/Modules/MapGenerator/UI/Models/TileInformationDisplay.cs b/Server/Modules/MapGenerator/UI/Models/TileInformationDisplay.cs index a9401ee..975971d 100644 --- a/Server/Modules/MapGenerator/UI/Models/TileInformationDisplay.cs +++ b/Server/Modules/MapGenerator/UI/Models/TileInformationDisplay.cs @@ -5,5 +5,5 @@ public enum TileInformationDisplay None, Position, Noise, - Path + Path, } diff --git a/Server/Modules/NoiseGenerator/Services/Perlin.cs b/Server/Modules/NoiseGenerator/Services/Perlin.cs index 6a58a00..424e752 100644 --- a/Server/Modules/NoiseGenerator/Services/Perlin.cs +++ b/Server/Modules/NoiseGenerator/Services/Perlin.cs @@ -259,7 +259,7 @@ public class Perlin 215, 61, 156, - 180 + 180, }; private static readonly int[] p; // Doubled permutation to avoid overflow diff --git a/Server/Modules/NoiseGenerator/Services/Utils.cs b/Server/Modules/NoiseGenerator/Services/Utils.cs index 0fac515..bd42679 100644 --- a/Server/Modules/NoiseGenerator/Services/Utils.cs +++ b/Server/Modules/NoiseGenerator/Services/Utils.cs @@ -36,7 +36,7 @@ public static Func[] GetCustomFunctions() CustomFunction2, CustomFunction3, CustomFunction4, - CustomFunction5 + CustomFunction5, }; } diff --git a/Server/Program.cs b/Server/Program.cs index daebe3a..df635f3 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -37,8 +37,8 @@ OpenAICompatibleInstructionProvider >(FeatureFlags.USE_AI); -builder.Services - .AddRazorComponents() +builder + .Services.AddRazorComponents() .AddInteractiveServerComponents() .AddInteractiveWebAssemblyComponents();