Skip to content

Commit

Permalink
Release 1.0.3.2 !
Browse files Browse the repository at this point in the history
  • Loading branch information
tommyettinger committed Aug 6, 2022
1 parent c0bcbab commit 512b6b3
Show file tree
Hide file tree
Showing 14 changed files with 714 additions and 75 deletions.
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,22 @@ The Json serialization also uses an especially-concise format to store each of t
[juniper](https://github.com/tommyettinger/juniper). Even though juniper is not a direct dependency of jdkgdxds, it used
to be part of that library, and its use is recommended with any of the randomized methods in jdkgdxds, so it still makes
sense to have here. These classes (`DistinctRandom`, `LaserRandom`, `TricycleRandom`, `FourWheelRandom`, `ChopRandom`,
`StrangerRandom`, `TrimRandom`, `MizuchiRandom`, `RomuTrioRandom`, and `Xoshiro256StarStarRandom`) are sometimes
serializable without jdkgdxds-interop, but work regardless of JDK version if you do use this library. Better still, you
can register `EnhancedRandom` for serialization, so places that have an `EnhancedRandom` but don't specify an
implementation can still store one (which includes its implementing class) and read an `EnhancedRandom` back. If you
have your own class that extends `java.util.Random`, then you probably want to register `AtomicLong` (which `Random`
uses internally, and which `JsonSupport` can do) or write your own serializer. The `RandomXS128` class in libGDX can
also be registered.
`WhiskerRandom`, `StrangerRandom`, `TrimRandom`, `MizuchiRandom`, `RomuTrioRandom`, `Xoshiro256StarStarRandom`, and
`Xoshiro128PlusPlusRandom`, ) are sometimes serializable without jdkgdxds-interop, but work regardless of JDK version if
you do use this library. Better still, you can register `EnhancedRandom` for serialization, so places that have an
`EnhancedRandom` but don't specify an implementation can still store one (which includes its implementing class) and
read an `EnhancedRandom` back. If you have your own class that extends `java.util.Random`, which is admittedly unlikely,
you should probably write your own serializer modeled after the serializer for the `RandomXS128` class in libGDX here.
Java 17 and higher block libGDX's `Json` class from accessing the state of `java.util.Random`, which also prevents any
serialization of subclasses unless they use custom serialization. This also means that `java.util.Random` can't be
serialized or deserialized by libGDX `Json` on JDK 17 or higher, even with a custom serializer, unless some special
additional work happens (and even that might not work on future JDKs).

Starting with juniper 0.1.0, it now contains quite a few statistical distributions, each of which stores some parameter
or parameters and an EnhancedRandom to generate numbers. These can all be registered individually or as a group by
`JsonSupport.registerDistribution()`. Once registered, you can store a `Distribution` much like an `EnhancedRandom`, and
it uses a similar compact storage system. You can also store a `Distribution` and deserialize it as a `Distribution`,
allowing any implementation to be fit into that variable.

The [digital](https://github.com/tommyettinger/digital) library is a direct dependency of jdkgdxds, and it has a
`Hasher` class that can be registered, as well as a `Base` class. `Base` is especially important here because you can
Expand All @@ -44,17 +53,17 @@ be handy to obfuscate numbers if you pass a scrambled base (as `Base` can genera
## How do I get it?
The Gradle dependency, with the usual caveats about optionally replacing `implementation` with `api`, is:
```groovy
implementation "com.github.tommyettinger:jdkgdxds_interop:1.0.3.1"
implementation "com.github.tommyettinger:jdkgdxds_interop:1.0.3.2"
```
It's not unlikely that you might need `api` instead of `implementation`, especially if you are writing a library, or a
module that needs to be used from another section.

If you use GWT (libGDX's HTML target), then you also need this in your `html/build.gradle` file:
```groovy
implementation "com.github.tommyettinger:digital:0.0.3:sources"
implementation "com.github.tommyettinger:juniper:0.0.2:sources"
implementation "com.github.tommyettinger:digital:0.0.4:sources"
implementation "com.github.tommyettinger:juniper:0.1.0:sources"
implementation "com.github.tommyettinger:jdkgdxds:1.0.3:sources"
implementation "com.github.tommyettinger:jdkgdxds_interop:1.0.3.1:sources"
implementation "com.github.tommyettinger:jdkgdxds_interop:1.0.3.2:sources"
```
You also need the GWT `inherits` in your `GdxDefinition.gwt.xml` file:
```xml
Expand All @@ -65,7 +74,4 @@ You also need the GWT `inherits` in your `GdxDefinition.gwt.xml` file:
<inherits name="jdkgdxds_interop" />
```

You still need to follow any instructions for jdkgdxds itself and libGDX, including at least 3 more `inherits` lines in
the .gwt.xml file if you use GWT (see jdkgdxds' README.md).

I hope that's all you need! It's a small-ish simple library!
2 changes: 1 addition & 1 deletion docs/apidocs/allclasses-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>All Classes and Interfaces (jdkgdxds_interop 1.0.3.1 API)</title>
<title>All Classes and Interfaces (jdkgdxds_interop 1.0.3.2 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="class index">
Expand Down
2 changes: 1 addition & 1 deletion docs/apidocs/allpackages-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>All Packages (jdkgdxds_interop 1.0.3.1 API)</title>
<title>All Packages (jdkgdxds_interop 1.0.3.2 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="package index">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ConversionToGDX (jdkgdxds_interop 1.0.3.1 API)</title>
<title>ConversionToGDX (jdkgdxds_interop 1.0.3.2 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: com.github.tommyettinger.ds.interop, class: ConversionToGDX">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<!-- Generated by javadoc (17) -->
<title>ConversionToJDK (jdkgdxds_interop 1.0.3.1 API)</title>
<title>ConversionToJDK (jdkgdxds_interop 1.0.3.2 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: com.github.tommyettinger.ds.interop, class: ConversionToJDK">
Expand Down
Loading

0 comments on commit 512b6b3

Please sign in to comment.