Пример #1
0
 public void giveMoney(UUID player, double amount, FinancialCallback callback) {
   new Thread(
           () -> {
             PlayerData data = getData(player);
             data.creditMoney(amount);
             if (callback != null) callback.done(data.getMoney(), amount);
           })
       .start();
 }
Пример #2
0
  public void transferMoney(UUID from, UUID to, double amount) {
    new Thread(
            () -> {
              PlayerData fromData = getData(from);
              PlayerData toData = getData(to);

              fromData.creditMoney(-amount);
              toData.creditMoney(amount);
            })
        .start();
  }
Пример #3
0
 public double getAmount(UUID player) {
   PlayerData data = getData(player);
   return data.getMoney();
 }