first commit
This commit is contained in:
commit
f0ea9603d5
14 changed files with 501 additions and 0 deletions
20
core-api/build.gradle.kts
Normal file
20
core-api/build.gradle.kts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
plugins {
|
||||
id("java")
|
||||
}
|
||||
|
||||
group = "de.kentoj.scrow"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(platform("org.junit:junit-bom:5.10.0"))
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package de.kentoj.scrow.services;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public interface EconomyService {
|
||||
|
||||
Mono<@NotNull Integer> getCoins(UUID playerId);
|
||||
|
||||
/**
|
||||
* @param playerId uuid of player
|
||||
* @return new coins balance
|
||||
*/
|
||||
Mono<@NotNull Integer> depositCoins(UUID playerId, int amount);
|
||||
|
||||
/**
|
||||
* @param playerId uuid of player
|
||||
* @return true on success, false on insufficient funds
|
||||
*/
|
||||
Mono<@NotNull Boolean> tryWithdrawCoins(UUID playerId, int amount);
|
||||
|
||||
/**
|
||||
* @param playerId uuid of player
|
||||
*/
|
||||
Mono<@NotNull Void> setCoins(UUID playerId, int amount);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue