RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.bags.impl.CoalBag Class Reference
Inheritance diagram for com.runehive.content.bags.impl.CoalBag:
Collaboration diagram for com.runehive.content.bags.impl.CoalBag:

Public Member Functions

void check (Player player)
 CoalBag ()
String getIndication ()
String getItem ()
String getName ()
Predicate< ItemisAllowed ()
Public Member Functions inherited from com.runehive.content.bags.ItemBag
void empty (Player player)
void fill (Player player)
 ItemBag (ItemContainer container)

Static Public Attributes

static final int SIZE = 27

Additional Inherited Members

Public Attributes inherited from com.runehive.content.bags.ItemBag
final ItemContainer container

Detailed Description

Definition at line 12 of file CoalBag.java.

Constructor & Destructor Documentation

◆ CoalBag()

com.runehive.content.bags.impl.CoalBag.CoalBag ( )

Definition at line 16 of file CoalBag.java.

16 {
17 super(new ItemContainer(SIZE, ItemContainer.StackPolicy.NEVER));
18 }

References com.runehive.game.world.items.containers.ItemContainer.StackPolicy.NEVER, and SIZE.

Member Function Documentation

◆ check()

void com.runehive.content.bags.impl.CoalBag.check ( Player player)

Reimplemented from com.runehive.content.bags.ItemBag.

Definition at line 41 of file CoalBag.java.

41 {
42 if(container.getFreeSlots() == SIZE) {
43 player.message("The "+getName()+" is empty.");
44 return;
45 }
46
47 player.message("The "+getName()+" contains "+container.computeAmountForId(453)+" pieces of coal.");
48 }

References com.runehive.content.bags.ItemBag.container, getName(), com.runehive.game.world.entity.mob.player.Player.message(), and SIZE.

Here is the call graph for this function:

◆ getIndication()

String com.runehive.content.bags.impl.CoalBag.getIndication ( )

Reimplemented from com.runehive.content.bags.ItemBag.

Definition at line 36 of file CoalBag.java.

36 {
37 return "is";
38 }

◆ getItem()

String com.runehive.content.bags.impl.CoalBag.getItem ( )

Reimplemented from com.runehive.content.bags.ItemBag.

Definition at line 21 of file CoalBag.java.

21 {
22 return "coal";
23 }

◆ getName()

String com.runehive.content.bags.impl.CoalBag.getName ( )

Reimplemented from com.runehive.content.bags.ItemBag.

Definition at line 26 of file CoalBag.java.

26 {
27 return "coal bag";
28 }

Referenced by check().

Here is the caller graph for this function:

◆ isAllowed()

Predicate< Item > com.runehive.content.bags.impl.CoalBag.isAllowed ( )

Reimplemented from com.runehive.content.bags.ItemBag.

Definition at line 31 of file CoalBag.java.

31 {
32 return coal -> Objects.nonNull(coal) && (ItemDefinition.get(coal.getId()).getName().startsWith("Coal") && !ItemDefinition.get(coal.getId()).getName().contains("bag")) && !ItemDefinition.get(coal.getId()).isStackable();
33 }

References com.runehive.game.world.items.ItemDefinition.get(), and com.runehive.game.world.items.ItemDefinition.getName().

Here is the call graph for this function:

Member Data Documentation

◆ SIZE

final int com.runehive.content.bags.impl.CoalBag.SIZE = 27
static

Definition at line 14 of file CoalBag.java.

Referenced by check(), and CoalBag().


The documentation for this class was generated from the following file: