RuneHive-Game
Loading...
Searching...
No Matches
MoveItemEvent.kt
Go to the documentation of this file.
1package org.jire.runehiveps.event.widget
2
3import com.runehive.game.world.InterfaceConstants
4import com.runehive.game.world.entity.mob.player.Player
5
6/**
7 * @author Jire
8 */
9class MoveItemEvent(
10 val interfaceId: Int,
11 val inserting: Int,
12 val fromSlot: Int,
13 val toSlot: Int
14) : WidgetEvent {
15
16 override fun handle(player: Player) {
17 when (interfaceId) {
18 InterfaceConstants.INVENTORY_INTERFACE,
19 InterfaceConstants.INVENTORY_STORE ->
20 player.inventory.swap(
21 fromSlot,
22 toSlot
23 )
24
25 InterfaceConstants.WITHDRAW_BANK ->
26 player.bank.moveItem(inserting, fromSlot, toSlot)
27
28 else -> println("Unkown Item movement itemcontainer id: $interfaceId")
29 }
30 }
31
32}