RuneHive-Game
Loading...
Searching...
No Matches
DonatorPointCurrency.java
Go to the documentation of this file.
1package com.runehive.content.store.currency.impl;
2
3import com.runehive.content.store.currency.Currency;
4import com.runehive.game.world.entity.mob.player.Player;
5import com.runehive.net.packet.out.SendMessage;
6
7public final class DonatorPointCurrency implements Currency {
8
9 @Override
10 public boolean tangible() {
11 return false;
12 }
13
14 @Override
15 public boolean takeCurrency(Player player, int amount) {
16 if (player.donation.getCredits() >= amount) {
17 player.donation.setCredits(player.donation.getCredits() - amount);
18 return true;
19 } else {
20 player.send(new SendMessage("You do not have enough donator points."));
21 return false;
22 }
23 }
24
25 @Override
26 public void recieveCurrency(Player player, int amount) {
27 player.donation.setCredits(player.donation.getCredits() + amount);
28 }
29
30 @Override
31 public int currencyAmount(Player player) {
32 return player.donation.getCredits();
33 }
34
35 @Override
36 public boolean canRecieveCurrency(Player player) {
37 return true;
38 }
39}
boolean tangible()
Determines if this currency is tangible.
boolean takeCurrency(Player player, int amount)
The method executed when the currency is taken from player.
boolean canRecieveCurrency(Player player)
Determines if the currency can be received when player's inventory is full.
void recieveCurrency(Player player, int amount)
The method executed when the currency is given to player.
int currencyAmount(Player player)
The method that retrieves the amount of currency player currently has.
This class represents a character controlled by a player.
Definition Player.java:125
The OutgoingPacket that sends a message to a Players chatbox in the client.
The parent class of all currencies that provides basic functionality for any general currency.
Definition Currency.java:11