|
RuneHive-Game
|
Public Member Functions | |
| void | accept (Player player) |
| Handles accepting the gamble. | |
| void | acceptRequest (Player player, Player other) |
| Handles accepting a request. | |
| boolean | canGamble (Player player, GambleStage requiredStage) |
| Checks if the player is allowed to gamble or not. | |
| boolean | canPlayFlowerPokerAtPositon (Player player, Position position) |
| Checks if the position that was selected is suitable for a game of flower poker. | |
| void | decline (Player player) |
| Handles declining the gamble. | |
| void | deposit (Player player, int itemId, int slot, int amount) |
| Deposit a item into the gamble session. | |
| void | finish (Player host, Player opponent, int hostScore, int opponentScore) |
| Handles finishing up a automated gamble. | |
| ItemContainer | getContainer () |
| ArrayList< Flowers > | getFlowers () |
| Gamble | getGame () |
| ArrayList< CustomGameObject > | getGameFlowers () |
| Player | getOther () |
| GambleStage | getStage () |
| GambleType | getType () |
| void | give (GambleType gambleType, char winnerIdentifier, Player winner, Player loser, boolean draw) |
| Handles giving the players the winnings or returning the items when its a draw. | |
| void | handleModeSelection (Player player, GambleType type) |
| Handles setting the different game types. | |
| boolean | hasConfirmed () |
| void | open (Player player, Player other) |
| Handles opening the interface. | |
| void | removeFlowers (Player player) |
| void | reset (Player player) |
| Handles resetting all the gambling variables for a player. | |
| void | sendRequest (Player player, Player other) |
| Handles sending a request to another player. | |
| void | setConfirmed (boolean confirmed) |
| void | setGame (Gamble game) |
| void | setOther (Player other) |
| void | setStage (GambleStage stage) |
| void | setType (GambleType type) |
| void | withdraw (Player player, int itemId, int slot, int amount) |
| Withdraw an item from the gamble session. | |
Static Public Attributes | |
| static final Boundary | GAMBLING_ZONE = new Boundary(3148, 3476, 3181, 3505) |
Protected Attributes | |
| boolean | confirmed |
| Checks if the player has confirmed the gamble. | |
| ItemContainer | container = new ItemContainer(18, ItemContainer.StackPolicy.STANDARD) |
| The container with gambled items of the player. | |
| ArrayList< Flowers > | flowers = new ArrayList<Flowers>() |
| Gamble | game |
| The current gamble going on between the two players. | |
| ArrayList< CustomGameObject > | gameFlowers = new ArrayList<CustomGameObject>() |
| Player | other |
| The other player within this gamble. | |
| GambleStage | stage = GambleStage.NONE |
| The current stage of the gamble. | |
| GambleType | type = GambleType.NONE |
| The gamble type going on. | |
Private Member Functions | |
| Gamble | getGame (Player other, Player player, GambleType type) |
| Get thet game based on the gamble type. | |
| void | send (GambleType gambleType, char winnerIdentifier, Player winner, Player loser) |
| Handles sending the message for who won. | |
| void | start (Player player) |
| Handles starting the gamble. | |
Private Attributes | |
| final int | CONFIG = 444 |
| The config used for selecting the game type. | |
| final int | INTERFACE_ID = 44750 |
| The main gambling interface. | |
| final int | INVENTORY_ID = 44775 |
| Interface id for the player's inventory. | |
Definition at line 22 of file GambleManager.java.
| void com.runehive.content.gambling.GambleManager.accept | ( | Player | player | ) |
Handles accepting the gamble.
| player |
Definition at line 222 of file GambleManager.java.
References game, com.runehive.game.world.entity.mob.player.Player.getGambling(), getGame(), com.runehive.game.world.entity.mob.player.Player.getLastModification(), getOther(), getType(), com.runehive.game.world.entity.mob.player.Player.getUsername(), hasConfirmed(), com.runehive.game.world.entity.mob.player.Player.message(), com.runehive.content.gambling.GambleType.NONE, other, com.runehive.content.gambling.GambleStage.SENDING_OFFER, setConfirmed(), setGame(), setOther(), setStage(), and start().
Handles accepting a request.
| player | |
| other |
Definition at line 183 of file GambleManager.java.
References canGamble(), com.runehive.game.world.entity.mob.player.Player.getGambling(), com.runehive.game.world.entity.Entity.getIndex(), com.runehive.content.gambling.GambleStage.NONE, open(), other, com.runehive.content.gambling.GambleStage.SENDING_OFFER, setOther(), and setStage().
Referenced by sendRequest().
| boolean com.runehive.content.gambling.GambleManager.canGamble | ( | Player | player, |
| GambleStage | requiredStage ) |
Checks if the player is allowed to gamble or not.
| player | |
| requiredStage |
Definition at line 132 of file GambleManager.java.
References GAMBLING_ZONE, com.runehive.game.world.entity.mob.player.Player.getGambling(), getStage(), and com.runehive.game.world.position.Boundary.isIn().
Referenced by acceptRequest(), and start().
| boolean com.runehive.content.gambling.GambleManager.canPlayFlowerPokerAtPositon | ( | Player | player, |
| Position | position ) |
Checks if the position that was selected is suitable for a game of flower poker.
| player | |
| position |
Definition at line 271 of file GambleManager.java.
References com.runehive.game.world.position.Position.create(), com.runehive.game.world.position.Position.getX(), com.runehive.game.world.position.Position.getY(), com.runehive.game.world.pathfinding.TraversalMap.isTraversable(), com.runehive.game.world.entity.mob.Direction.SOUTH, and com.runehive.game.world.entity.Entity.width.
Referenced by com.runehive.content.gambling.impl.FlowerPoker.gamble().
| void com.runehive.content.gambling.GambleManager.decline | ( | Player | player | ) |
Handles declining the gamble.
| player |
Definition at line 290 of file GambleManager.java.
References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.entity.mob.player.Player.bank, com.runehive.game.world.items.containers.ItemContainer.clear(), getContainer(), com.runehive.game.world.entity.mob.player.Player.getGambling(), getOther(), com.runehive.game.world.items.containers.ItemContainer.hasCapacityFor(), com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.entity.mob.player.Player.message(), other, com.runehive.game.world.items.containers.bank.Bank.refresh(), com.runehive.game.world.items.containers.inventory.Inventory.refresh(), and reset().
Referenced by com.runehive.game.world.entity.mob.player.Player.unregister().
| void com.runehive.content.gambling.GambleManager.deposit | ( | Player | player, |
| int | itemId, | ||
| int | slot, | ||
| int | amount ) |
Deposit a item into the gamble session.
| player | |
| slot |
Definition at line 336 of file GambleManager.java.
References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.items.containers.ItemContainer.computeAmountForId(), com.runehive.game.world.items.containers.ItemContainer.contains(), com.runehive.game.world.items.ItemDefinition.get(), getContainer(), com.runehive.game.world.entity.mob.player.Player.getGambling(), getOther(), com.runehive.game.world.items.containers.ItemContainer.hasCapacityFor(), com.runehive.game.world.entity.mob.player.Player.inventory, INVENTORY_ID, com.runehive.game.world.entity.mob.player.Player.message(), other, com.runehive.game.world.items.containers.inventory.Inventory.refresh(), com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.game.world.entity.mob.player.Player.setLastModification(), and com.runehive.game.world.items.containers.ItemContainer.toArray().
| void com.runehive.content.gambling.GambleManager.finish | ( | Player | host, |
| Player | opponent, | ||
| int | hostScore, | ||
| int | opponentScore ) |
Handles finishing up a automated gamble.
| host | |
| opponent | |
| hostScore | |
| opponentScore |
Definition at line 465 of file GambleManager.java.
References com.runehive.content.gambling.Gamble.gamble(), com.runehive.game.world.entity.mob.player.Player.getGambling(), getGame(), com.runehive.content.gambling.Gamble.getHost(), com.runehive.game.world.World.getPlayers(), getType(), give(), com.runehive.content.gambling.GambleStage.IN_PROGRESS, setStage(), and com.runehive.game.world.entity.mob.Mob.speak().
Referenced by com.runehive.content.gambling.impl.FiftyFive.gamble(), com.runehive.content.gambling.impl.FlowerPoker.gamble(), and com.runehive.content.gambling.impl.FlowerPoker.plant().
| ItemContainer com.runehive.content.gambling.GambleManager.getContainer | ( | ) |
Definition at line 109 of file GambleManager.java.
References container.
Referenced by decline(), deposit(), give(), open(), and withdraw().
| ArrayList< Flowers > com.runehive.content.gambling.GambleManager.getFlowers | ( | ) |
Definition at line 122 of file GambleManager.java.
References flowers.
Referenced by com.runehive.content.gambling.impl.FlowerPoker.gamble(), com.runehive.content.gambling.impl.FlowerPoker.getRank(), com.runehive.content.gambling.impl.FlowerPoker.plant(), and removeFlowers().
| Gamble com.runehive.content.gambling.GambleManager.getGame | ( | ) |
|
private |
Get thet game based on the gamble type.
| other | |
| player | |
| type |
Definition at line 419 of file GambleManager.java.
| ArrayList< CustomGameObject > com.runehive.content.gambling.GambleManager.getGameFlowers | ( | ) |
Definition at line 115 of file GambleManager.java.
References gameFlowers.
Referenced by com.runehive.content.gambling.impl.FlowerPoker.gamble(), and removeFlowers().
| Player com.runehive.content.gambling.GambleManager.getOther | ( | ) |
Definition at line 57 of file GambleManager.java.
References other.
Referenced by accept(), decline(), deposit(), handleModeSelection(), reset(), start(), and withdraw().
| GambleStage com.runehive.content.gambling.GambleManager.getStage | ( | ) |
Definition at line 44 of file GambleManager.java.
References stage.
Referenced by canGamble(), com.runehive.net.packet.in.DropItemPacketListener.handlePacket(), and reset().
| GambleType com.runehive.content.gambling.GambleManager.getType | ( | ) |
Definition at line 83 of file GambleManager.java.
References type.
Referenced by accept(), and finish().
| void com.runehive.content.gambling.GambleManager.give | ( | GambleType | gambleType, |
| char | winnerIdentifier, | ||
| Player | winner, | ||
| Player | loser, | ||
| boolean | draw ) |
Handles giving the players the winnings or returning the items when its a draw.
| gambleType | |
| winnerIdentifier | |
| winner | |
| loser | |
| draw |
Definition at line 500 of file GambleManager.java.
References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.items.containers.inventory.Inventory.addOrDrop(), com.runehive.game.world.entity.mob.player.Player.bank, com.runehive.game.world.items.containers.ItemContainer.clear(), container, com.runehive.content.gambling.Gamble.gamble(), getContainer(), com.runehive.game.world.entity.mob.player.Player.getGambling(), getGame(), com.runehive.game.world.items.containers.ItemContainer.hasCapacityFor(), com.runehive.content.gambling.GambleStage.IN_PROGRESS, com.runehive.game.world.entity.mob.player.Player.inventory, com.runehive.game.world.items.containers.bank.Bank.refresh(), removeFlowers(), reset(), send(), setStage(), and com.runehive.game.world.entity.mob.Mob.speak().
Referenced by finish().
| void com.runehive.content.gambling.GambleManager.handleModeSelection | ( | Player | player, |
| GambleType | type ) |
Handles setting the different game types.
| player | |
| type |
Definition at line 579 of file GambleManager.java.
References CONFIG, com.runehive.game.world.entity.mob.player.Player.getGambling(), getOther(), other, com.runehive.game.world.entity.mob.player.Player.send(), setConfirmed(), com.runehive.game.world.entity.mob.player.Player.setLastModification(), setType(), and type.
| boolean com.runehive.content.gambling.GambleManager.hasConfirmed | ( | ) |
Definition at line 70 of file GambleManager.java.
References confirmed.
Referenced by accept().
Handles opening the interface.
| player | |
| other |
Definition at line 203 of file GambleManager.java.
References CONFIG, getContainer(), com.runehive.game.world.entity.mob.player.Player.getGambling(), com.runehive.game.world.items.containers.ItemContainer.getItems(), com.runehive.game.world.entity.mob.player.Player.getUsername(), INTERFACE_ID, com.runehive.game.world.entity.mob.player.Player.inventory, INVENTORY_ID, other, com.runehive.content.gambling.GambleStage.PLACING_BET, com.runehive.game.world.entity.mob.player.Player.send(), setConfirmed(), setStage(), and com.runehive.game.world.items.containers.ItemContainer.toArray().
Referenced by acceptRequest().
| void com.runehive.content.gambling.GambleManager.removeFlowers | ( | Player | player | ) |
Definition at line 619 of file GambleManager.java.
References flowers, getFlowers(), com.runehive.game.world.entity.mob.player.Player.getGambling(), and getGameFlowers().
Referenced by give(), and reset().
| void com.runehive.content.gambling.GambleManager.reset | ( | Player | player | ) |
Handles resetting all the gambling variables for a player.
| player |
Definition at line 599 of file GambleManager.java.
References CONFIG, com.runehive.game.world.entity.mob.player.Player.getGambling(), getOther(), getStage(), com.runehive.content.gambling.GambleStage.NONE, removeFlowers(), reset(), com.runehive.game.world.entity.mob.player.Player.send(), setConfirmed(), com.runehive.game.world.entity.mob.player.Player.setGambleLock(), setGame(), setOther(), setStage(), and setType().
Referenced by decline(), give(), and reset().
|
private |
Handles sending the message for who won.
| gambleType | |
| winnerIdentifier | |
| winner | |
| loser |
Definition at line 559 of file GambleManager.java.
References com.runehive.game.world.entity.mob.Mob.speak().
Referenced by give().
Handles sending a request to another player.
| player | |
| other |
Definition at line 146 of file GambleManager.java.
References acceptRequest(), com.runehive.util.Utility.capitalizeSentence(), com.runehive.game.world.entity.mob.player.Player.getGambling(), com.runehive.game.world.entity.mob.player.Player.getName(), com.runehive.game.world.entity.mob.player.PlayerRight.isIronman(), com.runehive.game.world.entity.mob.player.Player.message(), other, com.runehive.game.world.entity.mob.player.Player.playTime, com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.content.gambling.GambleStage.SENDING_OFFER, setOther(), and setStage().
| void com.runehive.content.gambling.GambleManager.setConfirmed | ( | boolean | confirmed | ) |
Definition at line 74 of file GambleManager.java.
References confirmed.
Referenced by accept(), handleModeSelection(), open(), and reset().
| void com.runehive.content.gambling.GambleManager.setGame | ( | Gamble | game | ) |
Definition at line 100 of file GambleManager.java.
References game.
Referenced by accept(), and reset().
| void com.runehive.content.gambling.GambleManager.setOther | ( | Player | other | ) |
Definition at line 61 of file GambleManager.java.
References other.
Referenced by accept(), acceptRequest(), reset(), and sendRequest().
| void com.runehive.content.gambling.GambleManager.setStage | ( | GambleStage | stage | ) |
Definition at line 48 of file GambleManager.java.
References stage.
Referenced by accept(), acceptRequest(), finish(), give(), open(), reset(), sendRequest(), and start().
| void com.runehive.content.gambling.GambleManager.setType | ( | GambleType | type | ) |
Definition at line 87 of file GambleManager.java.
References type.
Referenced by handleModeSelection(), and reset().
|
private |
Handles starting the gamble.
| player |
Definition at line 433 of file GambleManager.java.
References canGamble(), com.runehive.content.gambling.Gamble.gamble(), com.runehive.game.world.entity.mob.player.Player.getGambling(), getGame(), com.runehive.content.gambling.Gamble.getHost(), getOther(), com.runehive.content.gambling.GambleStage.IN_PROGRESS, other, com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.content.gambling.GambleStage.SENDING_OFFER, com.runehive.game.world.entity.mob.player.Player.setGambleLock(), and setStage().
Referenced by accept().
| void com.runehive.content.gambling.GambleManager.withdraw | ( | Player | player, |
| int | itemId, | ||
| int | slot, | ||
| int | amount ) |
Withdraw an item from the gamble session.
| player | |
| slot |
Definition at line 379 of file GambleManager.java.
References com.runehive.game.world.items.containers.ItemContainer.add(), com.runehive.game.world.items.containers.ItemContainer.get(), com.runehive.game.world.items.Item.getAmount(), getContainer(), com.runehive.game.world.items.Item.getDefinition(), com.runehive.game.world.items.containers.ItemContainer.getFreeSlots(), com.runehive.game.world.entity.mob.player.Player.getGambling(), com.runehive.game.world.items.Item.getId(), getOther(), com.runehive.game.world.entity.mob.player.Player.inventory, INVENTORY_ID, other, com.runehive.game.world.items.containers.inventory.Inventory.refresh(), com.runehive.game.world.items.containers.ItemContainer.remove(), com.runehive.game.world.entity.mob.player.Player.send(), com.runehive.game.world.entity.mob.player.Player.setLastModification(), and com.runehive.game.world.items.containers.ItemContainer.toArray().
|
private |
The config used for selecting the game type.
Definition at line 35 of file GambleManager.java.
Referenced by handleModeSelection(), open(), and reset().
|
protected |
Checks if the player has confirmed the gamble.
Definition at line 68 of file GambleManager.java.
Referenced by hasConfirmed(), and setConfirmed().
|
protected |
The container with gambled items of the player.
Definition at line 107 of file GambleManager.java.
Referenced by getContainer(), and give().
|
protected |
Definition at line 120 of file GambleManager.java.
Referenced by getFlowers(), and removeFlowers().
|
static |
Definition at line 37 of file GambleManager.java.
Referenced by canGamble(), and com.runehive.game.world.entity.mob.player.Player.onStep().
|
protected |
The current gamble going on between the two players.
Definition at line 94 of file GambleManager.java.
|
protected |
Definition at line 113 of file GambleManager.java.
Referenced by getGameFlowers().
|
private |
The main gambling interface.
Definition at line 27 of file GambleManager.java.
Referenced by open().
|
private |
Interface id for the player's inventory.
Definition at line 31 of file GambleManager.java.
Referenced by deposit(), open(), and withdraw().
|
protected |
The other player within this gamble.
Definition at line 55 of file GambleManager.java.
Referenced by accept(), acceptRequest(), decline(), deposit(), getGame(), getOther(), handleModeSelection(), open(), sendRequest(), setOther(), start(), and withdraw().
|
protected |
The current stage of the gamble.
Definition at line 42 of file GambleManager.java.
Referenced by getStage(), and setStage().
|
protected |
The gamble type going on.
Definition at line 81 of file GambleManager.java.
Referenced by getGame(), getType(), handleModeSelection(), and setType().