mirror of
https://github.com/SimplexDevelopment/FreedomNetworkSuite.git
synced 2025-02-22 20:40:39 +00:00
Merge branch 'kitchen-sink' into Displayable-GUI-API
This commit is contained in:
commit
6631aebaa0
@ -1,7 +1,14 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* Represents an immutable transaction that has been fully handled by a {@link Transactor} instance
|
||||
*/
|
||||
public interface CompletedTransaction extends Transaction
|
||||
{
|
||||
|
||||
/**
|
||||
* Gets the final result of the {@link Transaction}
|
||||
*
|
||||
* @return the result
|
||||
*/
|
||||
TransactionResult getResult();
|
||||
}
|
||||
|
@ -1,8 +1,21 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* An entity that is able to transfer sums of currency between other {@link EconomicEntity}
|
||||
*/
|
||||
public interface EconomicEntity
|
||||
{
|
||||
/**
|
||||
* Gets the {@link EconomicEntityData} (which contains various common metadata about this {@link EconomicEntity}) associated with this class
|
||||
*
|
||||
* @return the {@link EconomicEntityData}
|
||||
*/
|
||||
EconomicEntityData getEconomicData();
|
||||
|
||||
/**
|
||||
* The name of the economic entity
|
||||
*
|
||||
* @return the economic entity's name
|
||||
*/
|
||||
String getName();
|
||||
}
|
||||
|
@ -1,14 +1,41 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* Metadata associated with a {@link EconomicEntity}
|
||||
*/
|
||||
public interface EconomicEntityData
|
||||
{
|
||||
/***
|
||||
* @return the transaction freeze state
|
||||
*/
|
||||
boolean areTransactionsFrozen();
|
||||
|
||||
/***
|
||||
* @return the balance
|
||||
*/
|
||||
long getBalance();
|
||||
|
||||
void setBalance(final long newBalance);
|
||||
|
||||
/**
|
||||
* Adds the provided amount to the associated instance's balance
|
||||
*
|
||||
* @param amount the amount to add
|
||||
* @return the new balance
|
||||
*/
|
||||
long addToBalance(final long amount);
|
||||
|
||||
/**
|
||||
* Subtracts the provided amount from the associated instance's balance
|
||||
*
|
||||
* @param amount the amount to subtract
|
||||
* @return the new balance
|
||||
*/
|
||||
long removeFromBalance(final long amount);
|
||||
|
||||
/**
|
||||
* Sets the balance of the associated instance
|
||||
*
|
||||
* @param newBalance the new balance
|
||||
*/
|
||||
void setBalance(final long newBalance);
|
||||
}
|
||||
|
@ -1,14 +1,32 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* Please ensure that all modifications of {@link MutableTransaction} happen BEFORE it is passed to a
|
||||
* {@link Transactor} implementation
|
||||
* A transaction that can be changed.
|
||||
* <p>
|
||||
* IMPORTANT NOTE: Please ensure that all modifications of {@link MutableTransaction} happen BEFORE it is passed to a {@link Transactor} implementation
|
||||
*/
|
||||
public interface MutableTransaction extends Transaction
|
||||
{
|
||||
/**
|
||||
* Adds a number to the balance transferred in this transaction
|
||||
*
|
||||
* @param amount the amount to add
|
||||
* @return the new amount
|
||||
*/
|
||||
long addToBalance(final long amount);
|
||||
|
||||
/**
|
||||
* Subtracts a number from the balance transferred in this transaction
|
||||
*
|
||||
* @param amount the amount to remove
|
||||
* @return the new amount
|
||||
*/
|
||||
long removeFromBalance(final long amount);
|
||||
|
||||
/**
|
||||
* Sets the balance transferred in this transaction
|
||||
*
|
||||
* @param newBalance the new balance of the transaction
|
||||
*/
|
||||
void setBalance(final long newBalance);
|
||||
}
|
||||
|
@ -1,11 +1,23 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* A class that denotes the transfer of currency between two EconomicEntity instances.
|
||||
*/
|
||||
public interface Transaction
|
||||
{
|
||||
/**
|
||||
* @return the initiating entity
|
||||
*/
|
||||
EconomicEntity getSource();
|
||||
|
||||
/**
|
||||
* @return the destination entity
|
||||
*/
|
||||
EconomicEntity getDestination();
|
||||
|
||||
/**
|
||||
* @return the balance transferred in this Transaction
|
||||
*/
|
||||
long getBalance();
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,14 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* A class that intercepts transactions after they are completed and logs them to a data point
|
||||
*/
|
||||
public interface TransactionLogger
|
||||
{
|
||||
/**
|
||||
* Logs a completed transaction
|
||||
*
|
||||
* @param completedTransaction the completed transaction to log
|
||||
*/
|
||||
void logTransaction(CompletedTransaction completedTransaction);
|
||||
}
|
||||
|
@ -2,6 +2,9 @@ package me.totalfreedom.economy;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
|
||||
/**
|
||||
* A class that represents the result of a transaction
|
||||
*/
|
||||
public interface TransactionResult
|
||||
{
|
||||
String getMessage();
|
||||
|
@ -1,6 +1,15 @@
|
||||
package me.totalfreedom.economy;
|
||||
|
||||
/**
|
||||
* A class that implements the completion of transactions.
|
||||
*/
|
||||
public interface Transactor
|
||||
{
|
||||
/**
|
||||
* Processes a transaction
|
||||
*
|
||||
* @param transaction the transaction to process
|
||||
* @return the completed transaction
|
||||
*/
|
||||
CompletedTransaction handleTransaction(MutableTransaction transaction);
|
||||
}
|
||||
|
53
README.md
53
README.md
@ -23,21 +23,21 @@
|
||||
###
|
||||
|
||||
[<img src="https://img.shields.io/static/v1?label=%20&message=Help%20Wanted&color=red&style=for-the-badge">](https://discord.gg/4PdtmrVNRx)
|
||||

|
||||

|
||||
[<img src="https://img.shields.io/github/issues/SimplexDevelopment/FreedomNetworkSuite?style=for-the-badge">](https://github.com/SimplexDevelopment/FreedomNetworkSuite/issues)
|
||||
[<img src="https://img.shields.io/github/issues-pr/SimplexDevelopment/FreedomNetworkSuite?style=for-the-badge">](https://github.com/SimplexDevelopment/FreedomNetworkSuite/pulls)
|
||||

|
||||

|
||||

|
||||

|
||||
[<img src="https://img.shields.io/github/issues/AtlasMediaGroup/Freedom-Network-Suite?style=for-the-badge">](https://github.com/AtlasMediaGroup/Freedom-Network-Suite/issues)
|
||||
[<img src="https://img.shields.io/github/issues-pr/AtlasMediaGroup/Freedom-Network-Suite?style=for-the-badge">](https://github.com/AtlasMediaGroup/Freedom-Network-Suite/pulls)
|
||||

|
||||

|
||||
|
||||
###
|
||||
|
||||
[<img src="https://img.shields.io/static/v1?label=Roadmap&message=Google%20Docs&color=4285F4&style=for-the-badge&logo=googledrive">](https://docs.google.com/document/d/197fwNo076RsCiPW6e6QWaGEzTGnDcRuf5FBA6lNeiPE)
|
||||
[<img src="https://img.shields.io/github/license/SimplexDevelopment/FreedomNetworkSuite?style=for-the-badge">](https://github.com/SimplexDevelopment/FreedomNetworkSuite/blob/kitchen-sink/LICENSE.md)
|
||||

|
||||

|
||||

|
||||

|
||||
[<img src="https://img.shields.io/github/license/AtlasMediaGroup/Freedom-Network-Suite?style=for-the-badge">](https://github.com/AtlasMediaGroup/Freedom-Network-Suite/blob/kitchen-sink/LICENSE.md)
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
# FreedomNetworkSuite
|
||||
@ -46,6 +46,7 @@ This is a proof of concept for a new suite of modules supported by a common libr
|
||||
This is designed to encompass the ideologies of a Freedom server, while maintaining full customization through modules.
|
||||
This is a ground up rewrite of [TotalFreedomMod].
|
||||
<br>
|
||||
<br>
|
||||
Honorable mention:
|
||||
<br>
|
||||
[<img src="https://img.shields.io/static/v1?label=Plex&message=A%20New%20Freedom%20Plugin&color=4285F4&style=flat-square&logo=plex)">](https://github.com/plexusorg/Plex)
|
||||
@ -76,33 +77,31 @@ Patchwork:
|
||||
- [x] Logging System
|
||||
- [x] SQL API
|
||||
- [x] Economy API
|
||||
- [ ] Command API
|
||||
- [ ] Particle API
|
||||
- [x] Command API
|
||||
- [x] Particle API
|
||||
- [x] User API
|
||||
- [ ] Ban API
|
||||
- [x] Service API
|
||||
- [x] Task API
|
||||
- [x] Permissions API
|
||||
- [ ] Configuration API
|
||||
- [ ] Event API
|
||||
- [ ] Configuration API *(In Progress...)*
|
||||
- [ ] Event API *(In Progress...)*
|
||||
|
||||
Datura:
|
||||
|
||||
- [ ] Permission Handling
|
||||
- [ ] Permission Registration & Assignment
|
||||
- [ ] SQL Data Handling
|
||||
- [ ] Configuration Implementations
|
||||
- [ ] User Data Implementations
|
||||
- [ ] Banning Implementation
|
||||
- [ ] Punishment Systems (e.x. Locker, Halter, Muter, Cager)
|
||||
- [ ] Permission Handling *(In Progress...)*
|
||||
- [ ] Permission Registration & Assignment *(In Progress...)*
|
||||
- [ ] SQL Data Handling *(In Progress...)*
|
||||
- [ ] Configuration Implementations
|
||||
- [ ] User Data Implementations *(In Progress...)*
|
||||
- [x] Punishment Systems (e.x. Locker, Halter, Cager)
|
||||
|
||||
Fossil:
|
||||
|
||||
- [x] Economy Implementation
|
||||
- [ ] Particle Implementation / Trails
|
||||
- [ ] Command Implementations
|
||||
- [ ] Implement a shop for the economy
|
||||
- [ ] Chat reaction / game system
|
||||
- [ ] Particle Implementation / Trails *(In Progress...)*
|
||||
- [ ] Command Implementations *(In Progress...)*
|
||||
- [ ] Implement a shop for the economy *(In Progress...)*
|
||||
- [ ] Chat reaction / game system
|
||||
- [ ] Jumppads
|
||||
|
||||
Corvo:
|
||||
|
Loading…
x
Reference in New Issue
Block a user