Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7e93fe5
Refactor to reduce test code duplication
PRiewe-SSA Jan 6, 2026
9492aae
Refactor to reduce test code duplication
PRiewe-SSA Jan 7, 2026
f5b0f19
Wilderness test
PRiewe-SSA Jan 7, 2026
de776e8
Wilderness and TownGenerator tests
PRiewe-SSA Jan 7, 2026
1cd5c3e
Start using Jackson for XML serde
PRiewe-SSA Jan 7, 2026
8e70b1b
Next class using Jackson XML
PRiewe-SSA Jan 7, 2026
63568ee
Fix windows filenames
PRiewe Jan 7, 2026
0668e0c
Jackson XML for RCreature
PRiewe-SSA Jan 7, 2026
48062bd
Jackson XML Wave 1
PRiewe-SSA Jan 7, 2026
2fdbcd1
Merge remote-tracking branch 'origin/feature/generator-test-refactor'…
PRiewe-SSA Jan 7, 2026
3353fb4
Jackson XML Wave 2
PRiewe-SSA Jan 7, 2026
a66ab9e
Jackson XML Wave 3
PRiewe-SSA Jan 7, 2026
4ddb8ee
Fixed RQuest serialization
PRiewe-SSA Jan 7, 2026
3a3a4d4
Jackson Migration Phase 1
PRiewe-SSA Jan 8, 2026
02f68fb
Jackson Migration Phase 1B
PRiewe-SSA Jan 8, 2026
48ab502
Jackson Migration Phase 1C
PRiewe-SSA Jan 8, 2026
76076c3
Jackson Migration Phase 1C
PRiewe-SSA Jan 8, 2026
153868f
Jackson Migration Phase 1D
PRiewe-SSA Jan 8, 2026
431cef9
Jackson Migration Phase 2A
PRiewe-SSA Jan 8, 2026
9a9a590
Jackson Migration Phase 2B
PRiewe-SSA Jan 8, 2026
3321844
Jackson Migration Phase 2C
PRiewe-SSA Jan 8, 2026
1a6ad0e
Jackson Migration Phase 3A
PRiewe-SSA Jan 8, 2026
85bda96
Jackson Migration Phase 3B
PRiewe-SSA Jan 8, 2026
e4ee68e
Jackson Migration Phase 3C
PRiewe-SSA Jan 8, 2026
e83e476
Jackson Migration Phase 4
PRiewe-SSA Jan 8, 2026
a63eb0a
Jackson Migration Phase 5
PRiewe-SSA Jan 8, 2026
5ae21ca
Jackson Migration Phase 6
PRiewe-SSA Jan 8, 2026
47926c9
Jackson Migration Phase 6A
PRiewe-SSA Jan 8, 2026
410edb8
Use svg library
PRiewe-SSA Jan 8, 2026
03e51da
Fix svg
PRiewe-SSA Jan 8, 2026
d7ae066
Quest serialization/deserialization
PRiewe-SSA Jan 9, 2026
ae3e271
Editor save using JacksonXmlBuilder
PRiewe-SSA Jan 9, 2026
2fac88e
Jdom elimination phase 1
PRiewe-SSA Jan 9, 2026
dde82ee
Jdom elimination phase 2
PRiewe-SSA Jan 9, 2026
784955d
Tweaking
PRiewe-SSA Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,26 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M9</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>

</plugins>
</build>
Expand All @@ -110,6 +130,11 @@
<artifactId>jdom2</artifactId>
<version>2.0.6.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.16.1</version>
</dependency>
<dependency>
<groupId>org.graalvm.polyglot</groupId>
<artifactId>polyglot</artifactId>
Expand All @@ -132,7 +157,12 @@
<artifactId>mbassador</artifactId>
<version>1.3.2</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.github.weisj/jsvg -->
<dependency>
<groupId>com.github.weisj</groupId>
<artifactId>jsvg</artifactId>
<version>1.7.2</version>
</dependency>
<dependency>
<groupId>net.phys2d</groupId>
<artifactId>phys2d</artifactId>
Expand Down
27 changes: 27 additions & 0 deletions src/main/java/neon/core/DefaultGameContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@

import java.util.EventObject;
import lombok.Setter;
import neon.core.event.TaskQueue;
import neon.entities.Player;
import neon.entities.UIDStore;
import neon.maps.Atlas;
import neon.narrative.QuestTracker;
import neon.resources.ResourceManager;
import neon.systems.files.FileSystem;
import neon.systems.physics.PhysicsSystem;
import neon.systems.timing.Timer;
import net.engio.mbassy.bus.MBassador;
Expand All @@ -48,6 +50,9 @@ public class DefaultGameContext implements GameContext {
@Setter private PhysicsSystem physicsEngine;
@Setter private Context scriptEngine;
@Setter private MBassador<EventObject> bus;
@Setter private FileSystem fileSystem;
@Setter private TaskQueue queue;
@Setter private Engine engine;

// Game-level state (set when a game starts)
@Setter private Game game;
Expand Down Expand Up @@ -111,4 +116,26 @@ public void quit() {
public void post(EventObject event) {
bus.publishAsync(event);
}

@Override
public FileSystem getFileSystem() {
return fileSystem;
}

@Override
public TaskQueue getQueue() {
return queue;
}

@Override
public void startGame(Game game) {
// Delegate to Engine's startGame implementation
// Engine is responsible for registering handlers and setting up script bindings
if (engine != null) {
engine.startGame(game);
} else {
// Fallback for tests that don't have an Engine instance
setGame(game);
}
}
}
5 changes: 4 additions & 1 deletion src/main/java/neon/core/Engine.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public Engine(Port port) throws IOException {
context.setPhysicsEngine(physics);
context.setScriptEngine(engine);
context.setBus(bus);
context.setFileSystem(files);
context.setQueue(queue);
context.setEngine(this);
}

/** This method is the run method of the gamethread. It sets up the event system. */
Expand All @@ -126,7 +129,7 @@ public void run() {
bus.subscribe(new InventoryHandler());
bus.subscribe(adapter);
bus.subscribe(quests);
bus.subscribe(new GameLoader(this, config));
bus.subscribe(new GameLoader(context, config));
bus.subscribe(new GameSaver(queue));
}

Expand Down
23 changes: 23 additions & 0 deletions src/main/java/neon/core/GameContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
package neon.core;

import java.util.EventObject;
import neon.core.event.TaskQueue;
import neon.entities.Player;
import neon.entities.UIDStore;
import neon.maps.Atlas;
import neon.narrative.QuestTracker;
import neon.resources.ResourceManager;
import neon.systems.files.FileSystem;
import neon.systems.physics.PhysicsSystem;
import neon.systems.timing.Timer;
import org.graalvm.polyglot.Context;
Expand Down Expand Up @@ -76,6 +78,20 @@ public interface GameContext {
*/
ResourceManager getResources();

/**
* Returns the file system.
*
* @return the file system for accessing game data files
*/
FileSystem getFileSystem();

/**
* Returns the task queue.
*
* @return the task queue for deferred execution
*/
TaskQueue getQueue();

/**
* Returns the quest tracker.
*
Expand Down Expand Up @@ -116,4 +132,11 @@ public interface GameContext {
* @param event the event to post
*/
void post(EventObject event);

/**
* Starts a new game with the provided game instance.
*
* @param game the game instance to start
*/
void startGame(Game game);
}
Loading
Loading