Skip to content

LuminiaDev/DynamicEconomy

Repository files navigation

DynamicEconomy

This library is designed to dynamically regulate the prices of the game market

Example of usage:

DynamicEconomy dynamicEconomy = DynamicEconomy.builder()
        .itemController(new BasicItemController(id -> switch (id) {
            case "bread" -> new ItemData(10, 50);
            case "apple" -> new ItemData(5, 25);
            default -> null;
        }, ItemData.EMPTY))
        .priceController(new ScaledPriceController(0.5))
        .build();

double price = dynamicEconomy.getCurrentPrice("bread");
dynamicEconomy.decreaseItemCount("bread", 1);

More use cases can be found here

Maven

Adding repo:

<repository>
    <id>luminiadev-repository-snapshots</id>
    <url>https://repo.luminiadev.com/snapshots</url>
</repository>

Adding dependency:

<dependency>
    <groupId>com.mefrreex.dynamiceconomy</groupId>
    <artifactId>dynamiceconomy</artifactId>
    <version>1.0.4-SNAPSHOT</version>
</dependency>

Gradle

Adding repo:

maven {
    name = "luminiadevRepositorySnapshots"
    url = uri("https://repo.luminiadev.com/snapshots")
}

Adding dependency:

implementation "com.mefrreex.dynamiceconomy:dynamiceconomy:1.0.4-SNAPSHOT"

About

Library for dynamic price regulation of the game market

Resources

Stars

Watchers

Forks

Languages