mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-01 02:14:32 +07:00
Moved ItemData#drop and added ItemManager#dropCursor
This commit is contained in:
parent
6280e89d8b
commit
7336c2a3b0
@ -14,6 +14,10 @@ public class ItemManager extends PassiveSystem {
|
||||
|
||||
protected ComponentMapper<Player> mPlayer;
|
||||
|
||||
public void dropCursor(int entityId) {
|
||||
mPlayer.get(entityId).data.dropCursor();
|
||||
}
|
||||
|
||||
public void storeToCursor(int entityId, int i) {
|
||||
mPlayer.get(entityId).data.storeToCursor(i);
|
||||
}
|
||||
|
@ -204,14 +204,6 @@ public class ItemData {
|
||||
return copy;
|
||||
}
|
||||
|
||||
void pickup(int i) {
|
||||
assert cursor == INVALID_ITEM;
|
||||
Item item = itemData.get(i);
|
||||
if (item.location == Location.STORED) notifyStoreRemoved(item);
|
||||
cursor = i;
|
||||
setLocation(item, Location.CURSOR);
|
||||
}
|
||||
|
||||
// TODO: should item location change if the item is dropped? is this what UNK3 and UNK5 represent?
|
||||
void drop() {
|
||||
assert cursor != INVALID_ITEM;
|
||||
@ -220,6 +212,14 @@ public class ItemData {
|
||||
setLocation(item, null);
|
||||
}
|
||||
|
||||
void pickup(int i) {
|
||||
assert cursor == INVALID_ITEM;
|
||||
Item item = itemData.get(i);
|
||||
if (item.location == Location.STORED) notifyStoreRemoved(item);
|
||||
cursor = i;
|
||||
setLocation(item, Location.CURSOR);
|
||||
}
|
||||
|
||||
void storeCursor(StoreLoc storeLoc, int x, int y) {
|
||||
assert cursor != INVALID_ITEM;
|
||||
store(storeLoc, cursor, x, y);
|
||||
|
Loading…
Reference in New Issue
Block a user