Giter Club home page Giter Club logo

economy's Introduction

Economy

This module aims to provide a very generic framework to simulate an economy with consumers and producers. On top of that however, it provides a robust method to share/trade/exchange resources between entities. It does so under a very libertarian credo: Use any storage component you want.

To see how you can get started with it and how you can hook it into your module see the wiki!

Features

Optional Shop Screen

This module can provide an alternative Inventory Screen that displays an in-game shop with purchasable items in addition to the regular player inventory. Whether this alternative screen is shown depends on the presence (or absence) of the AllowShopScreenComponent on a client entity.

By default, clients cannot see the alternative shop screen.

To enable it, add an event handler to ensure that joining clients will have the AllowShopScreenComponent attached to their entity. You may use the following code snippet and add it to a registered system.

/**
 * Ensure that the client has the {@link AllowShopScreenComponent} such that they can use the in-game shop from the Economy module.
 * @param event connection event when a client (and their player) joins a game/server
 * @param entity the client entity
 */
@ReceiveEvent
public void onConnect(ConnectedEvent event, EntityRef entity) {
    entity.upsertComponent(AllowShopScreenComponent.class, c -> c.orElse(new AllowShopScreenComponent()));
}

Credits

Gold coin: https://openclipart.org/detail/227733/pixel-gold-coin

economy's People

Contributors

cptcrispycrunchy avatar mayant15 avatar darkweird avatar jdrueckert avatar keturn avatar pollend avatar skaldarnar avatar cervator avatar mdj117 avatar andytechguy avatar ahv15 avatar qwertygiy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.