Skip to content

Commit

Permalink
refactor: use single seed in item generator
Browse files Browse the repository at this point in the history
  • Loading branch information
ktos committed Dec 17, 2024
1 parent 9b28bab commit acc9b2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Server/Modules/Items/Services/ItemGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Text.Json;
using Fracture.Server.Modules.AI.Services;
using Fracture.Server.Modules.Items.Models;
using Fracture.Server.Modules.NoiseGenerator.Models;
using Fracture.Server.Modules.Shared;
using Fracture.Server.Modules.Shared.Configuration;
using Microsoft.FeatureManagement;
Expand All @@ -19,14 +20,15 @@ public class ItemGenerator : IItemGenerator
public ItemGenerator(

Check warning on line 20 in Server/Modules/Items/Services/ItemGenerator.cs

View workflow job for this annotation

GitHub Actions / Checks

Non-nullable field '_featureManager' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
INameGenerator nameGenerator,
PrefixesGenerator prefixes,
NoiseParameters noiseParameters,
IAIInstructionProvider? ai = null
)
{
_nameGenerator = nameGenerator;
_prefixes = prefixes;
_ai = ai;

_rnd = new Random();
_rnd = new Random(noiseParameters.Seed);

var configData = File.ReadAllText("itemgeneratorconfig.json");
_modifiers = JsonSerializer.Deserialize<List<RarityModifier>>(configData)!;
Expand Down

0 comments on commit acc9b2d

Please sign in to comment.