Skip to content

Commit 60665a7

Browse files
committed
refactor(rng): use MathfloatP for deterministic operations
chore(deps): update dependency to com.gamelovers.gamedata build(release): bump version to 1.0.1 and update changelog
1 parent 6f140d1 commit 60665a7

File tree

7 files changed

+18
-11
lines changed

7 files changed

+18
-11
lines changed

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- **Package**: `com.gamelovers.services`
55
- **Unity**: 6000.0+
66
- **Dependencies** (see `package.json`)
7-
- `com.gamelovers.dataextensions` (**0.6.2**) (contains `floatP`, used by `RngService`)
7+
- `com.gamelovers.gamedata` (**1.0.0**) (contains `floatP`, used by `RngService`)
88

99
This package provides a set of small, modular “foundation services” for Unity projects (service locator/DI-lite, messaging, ticking, coroutines, pooling, persistence, RNG, time, and build version helpers).
1010

@@ -90,7 +90,7 @@ For user-facing docs, treat `README.md` as the primary entry point. This file is
9090

9191
## 6. External Package Sources (for API lookups)
9292
Prefer local UPM cache / local packages when needed:
93-
- DataExtensions: `Packages/com.gamelovers.dataextensions/` (e.g., `floatP`)
93+
- GameData: `Packages/com.gamelovers.gamedata/` (e.g., `floatP`)
9494
- Unity Newtonsoft JSON (Unity package): check `Library/PackageCache/` if you need source details
9595

9696
## 7. Dev Workflows (common changes)

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this package will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.0.1] - 2026-01-14
8+
9+
**Changed**:
10+
- Updated dependency `com.gamelovers.dataextensions` to `com.gamelovers.gamedata`
11+
- Updated assembly definitions to reference `GameLovers.GameData`
12+
713
## [1.0.0] - 2026-01-11
814

915
**New**:

Runtime/GameLovers.Services.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "GameLovers.Services",
33
"rootNamespace": "",
44
"references": [
5-
"GUID:22c6cdfa54ae844a9a9eda2f0014b020"
5+
"GameLovers.GameData"
66
],
77
"includePlatforms": [],
88
"excludePlatforms": [],

Runtime/RngService.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using GameLovers.GameData;
34

45
namespace GameLovers.Services
56
{
@@ -220,12 +221,12 @@ public static int Range(int min, int max, int[] rndState, bool maxInclusive)
220221
/// </remarks>
221222
public static floatP Range(floatP min, floatP max, int[] rndState, bool maxInclusive)
222223
{
223-
if (min > max || (!maxInclusive && Math.Abs(min - max) < floatP.Epsilon))
224+
if (min > max || (!maxInclusive && MathfloatP.Abs(min - max) < floatP.Epsilon))
224225
{
225226
throw new IndexOutOfRangeException("The min range value must be less the max range value");
226227
}
227228

228-
if (Math.Abs(min - max) < floatP.Epsilon)
229+
if (MathfloatP.Abs(min - max) < floatP.Epsilon)
229230
{
230231
return min;
231232
}
@@ -281,7 +282,7 @@ public static RngData CreateRngData(int seed)
281282
/// </summary>
282283
public static int[] GenerateRngState(int seed)
283284
{
284-
var value = _basicSeed - (seed == int.MinValue ? int.MaxValue : Math.Abs(seed));
285+
var value = _basicSeed - (seed == int.MinValue ? int.MaxValue : System.Math.Abs(seed));
285286
var state = new int[_stateLength];
286287

287288
state[_stateLength - 1] = value;

Tests/EditMode/GameLovers.Services.Tests.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"UnityEngine.TestRunner",
66
"UnityEditor.TestRunner",
77
"GameLovers.Services",
8-
"GameLovers.DataExtensions",
8+
"GameLovers.GameData",
99
"Unity.PerformanceTesting"
1010
],
1111
"includePlatforms": [

Tests/PlayMode/GameLovers.Services.Tests.Playmode.asmdef

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"UnityEngine.TestRunner",
66
"UnityEditor.TestRunner",
77
"GameLovers.Services",
8-
"GameLovers.DataExtensions",
8+
"GameLovers.GameData",
99
"Unity.PerformanceTesting"
1010
],
1111
"includePlatforms": [],

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "com.gamelovers.services",
3-
"displayName": "Services",
3+
"displayName": "GameLovers Services",
44
"author": "Miguel Tomas",
5-
"version": "1.0.0",
5+
"version": "1.0.1",
66
"unity": "6000.0",
77
"license": "MIT",
88
"description": "The purpose of this package is to provide a set of services to ease the development of a basic game architecture",
99
"type": "library",
1010
"hideInEditor": false,
1111
"dependencies": {
12-
"com.gamelovers.dataextensions": "0.6.2"
12+
"com.gamelovers.gamedata": "1.0.0"
1313
}
1414
}

0 commit comments

Comments
 (0)