Because why not? :)
(In this example I used "RETREAT.SC2" from SimCity 2000's City folder)
Code:
SC2KCity city = TemmieSC2KParser.loadCity(new File("path to sc2 file"));
System.out.println(city.getCityName());
Output:
Kathy's Retreat
You can also use Kotlin
Code:
var city = TemmieSC2KParser.loadCity(File("path to sc2 file"));
println(city.cityName);
Output:
Kathy's Retreat
Simple as that, have fun!
- David Moews, for creating the only (and the most used!) SimCity 2000 save file documentation: http://djm.cc/simcity-2000-info.txt
- rakama, for creating Minecraft-SC2MC which helped me a lot to understand how decompressing SC2K data worked.
- dwfennell, for creating city-parser-2000, a SC2K map parser in C#
You can use TemmieSC2KParser with Maven by using Jitpack. (sorry, I don't have a maven repo yet 😢)
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.MrPowerGamerBR</groupId>
<artifactId>TemmieSC2KParser</artifactId>
<version>-SNAPSHOT</version>
</dependency>
Guava
Why not Temmie?