RuneHive-Game
Loading...
Searching...
No Matches
Currency.java
Go to the documentation of this file.
1package com.runehive.content.store.currency;
2
3import com.runehive.game.world.entity.mob.player.Player;
4
5/**
6 * The parent class of all currencies that provides basic functionality for any
7 * general currency. This can be used to register tangible, and even intangible
8 * currencies.
9 * @author lare96 <http://github.com/lare96>
10 */
11public interface Currency {
12
13 /**
14 * Determines if this currency is tangible.
15 * @return {@code true} if this currency is tangible, {@code false} otherwise.
16 */
17 boolean tangible();
18
19 /**
20 * The method executed when the currency is taken from {@code player}.
21 * @param player the player the currency is taken from.
22 * @param amount the amount of currency that is taken.
23 */
24 boolean takeCurrency(Player player, int amount);
25
26 /**
27 * The method executed when the currency is given to {@code player}.
28 * @param player the player the currency is given to.
29 * @param amount the amount of currency that is given.
30 */
31 void recieveCurrency(Player player, int amount);
32
33 /**
34 * The method that retrieves the amount of currency {@code player} currently
35 * has.
36 * @param player the player who's currency amount will be determined.
37 * @return the amount of the currency the player has.
38 */
40
41 /**
42 * Determines if the currency can be received when {@code player}'s
43 * inventory is full.
44 * @param player the player to determine this for.
45 * @return {@code true} if the currency can be recieved, {@code false}
46 * otherwise.
47 */
48 boolean canRecieveCurrency(Player player);
49
50 /**
51 * Gets the name of the currency.
52 */
53 String toString();
54}
55
This class represents a character controlled by a player.
Definition Player.java:125
The parent class of all currencies that provides basic functionality for any general currency.
Definition Currency.java:11
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.
int currencyAmount(Player player)
The method that retrieves the amount of currency player currently has.
void recieveCurrency(Player player, int amount)
The method executed when the currency is given to player.
String toString()
Gets the name of the currency.