Skip to content

Commit

Permalink
Updated after b3dgs/lionengine#811
Browse files Browse the repository at this point in the history
Updated after b3dgs/lionengine#808
  • Loading branch information
DjThunder committed Dec 22, 2023
1 parent 891c9c3 commit 6e73a0e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ private static Xml saveFeaturable(Featurable featurable)
final Xml root = new Xml(EntityConfig.NODE_ENTITY);
featurable.getFeatures().forEach(feature ->
{
if (feature instanceof XmlSaver)
if (feature instanceof final XmlSaver saver)
{
((XmlSaver) feature).save(root);
saver.save(root);
}
});
return root;
Expand Down
4 changes: 2 additions & 2 deletions lionheart-game/src/main/java/com/b3dgs/lionheart/Util.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ public static void loadEntityFeature(Featurable entity, EntityConfig config)
{
entity.getFeatures().forEach(feature ->
{
if (feature instanceof XmlLoader)
if (feature instanceof final XmlLoader loader)
{
((XmlLoader) feature).load(config.getRoot());
loader.load(config.getRoot());
}
});
}
Expand Down
8 changes: 4 additions & 4 deletions lionheart-game/src/main/java/com/b3dgs/lionheart/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -1307,9 +1307,9 @@ private void saveSnapshotables(FileWriting file) throws IOException
file.writeString(featurable.getMedia().getPath());
for (final Feature feature : featurable.getFeatures())
{
if (feature instanceof Snapshotable)
if (feature instanceof final Snapshotable snapshotable)
{
((Snapshotable) feature).save(file);
snapshotable.save(file);
}
}
}
Expand Down Expand Up @@ -1369,9 +1369,9 @@ private void loadSnapshotable(FileReading file) throws IOException
}
for (final Feature feature : featurable.getFeatures())
{
if (feature instanceof Snapshotable)
if (feature instanceof final Snapshotable snapshotable)
{
((Snapshotable) feature).load(file);
snapshotable.load(file);
}
}
handler.add(featurable);
Expand Down
16 changes: 16 additions & 0 deletions lionheart-pc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<jna.version>5.14.0</jna.version>
<sdl2gdx.version>1.0.4</sdl2gdx.version>
<checkstyle.skip>true</checkstyle.skip>
<log4j2.version>2.22.0</log4j2.version>
</properties>
<repositories>
<repository>
Expand All @@ -33,6 +34,21 @@
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j2-impl</artifactId>
<version>${log4j2.version}</version>
</dependency>
<dependency>
<groupId>com.b3dgs.lionengine</groupId>
<artifactId>lionengine-core-awt</artifactId>
Expand Down

0 comments on commit 6e73a0e

Please sign in to comment.