https://github.com/levelz-file/java-bindings
Java, Kotlin (JVM) Parser & API for LevelZ File Format
https://github.com/levelz-file/java-bindings
java kotlin kotlin-jvm levelz
Last synced: 4 months ago
JSON representation
Java, Kotlin (JVM) Parser & API for LevelZ File Format
- Host: GitHub
- URL: https://github.com/levelz-file/java-bindings
- Owner: LevelZ-File
- License: mit
- Created: 2024-03-01T23:26:22.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-02-23T01:00:45.000Z (4 months ago)
- Last Synced: 2025-02-23T02:18:11.933Z (4 months ago)
- Topics: java, kotlin, kotlin-jvm, levelz
- Language: Java
- Homepage: https://levelz-file.github.io/java-bindings/
- Size: 550 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# levelz-java
> Java & Kotlin Parser & API For LevelZ File Format
[](https://jitpack.io/#LevelZ-File/java-bindings)
## Overview
Provides Java & Kotlin Parsing/Support for the LevelZ File Format.
### Download
Maven
```xml
calculus-games
https://repo.calcugames.xyz/repository/maven-releases/
xyz.calcugames
levelz-java
[VERSION]
```
Gradle (Groovy)
```groovy
// Add Calculus Games Repository
repositories {
maven { url 'https://repo.calcugames.xyz/repository/maven-releases/' }
}dependencies {
implementation 'xyz.calcugames:levelz-java:[VERSION]'
}
```Gradle (Kotlin DSL)
```kts
// Add Calculus Games Repository
repositories {
maven("https://repo.calcugames.xyz/repository/maven-releases/")
}dependencies {
implementation("xyz.calcugames:levelz-java:[VERSION]")
}
```
## Usage### Java
```java
Coordinate2D coordinate2D = new Coordinate2D(1, 2);
Coordinate3D coordinate3D = new Coordinate3D(1, 2, 3);
``````java
public class Main {
public static void main(String[] args) {
// Resource from JAR
InputStream is = Main.class.getResourceAsStream("/example_2d.lvlz");
Level2D level = (Level2D) LevelParser.builder()
.input(is)
.build()
.parse();
// Resource from File
File file = new File("example_2d.lvlz");
Level2D level = (Level2D) LevelParser.builder()
.input(file)
.build()
.parse();
}
}```
### Kotlin
```kotlin
val (x, y) = Coordinate2D(1, 2)
val (x, y, z) = Coordinate3D(1, 2, 3)
``````kotlin
fun main() {
// Resource from JAR
val input = Main::class.java.getResourceAsStream("/example_3d.lvlz")
val level = LevelParser.builder()
.input(input)
.build()
.parse().as3D// Resource from File
val file = File("example_3d.lvlz")
val level = LevelParser.builder()
.input(file)
.build()
.parse().as3D
}```