mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-01 02:14:32 +07:00
Created ItemManager system to interface char data item events with engine
This commit is contained in:
parent
e1443d0acf
commit
c6468eb788
57
core/src/com/riiablo/engine/server/ItemManager.java
Normal file
57
core/src/com/riiablo/engine/server/ItemManager.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.riiablo.engine.server;
|
||||
|
||||
import com.artemis.ComponentMapper;
|
||||
import com.artemis.annotations.All;
|
||||
import com.riiablo.engine.server.component.Player;
|
||||
import com.riiablo.item.BodyLoc;
|
||||
import com.riiablo.item.StoreLoc;
|
||||
|
||||
import net.mostlyoriginal.api.system.core.PassiveSystem;
|
||||
|
||||
@All(Player.class)
|
||||
public class ItemManager extends PassiveSystem {
|
||||
private static final String TAG = "ItemManager";
|
||||
|
||||
protected ComponentMapper<Player> mPlayer;
|
||||
|
||||
public void storeToCursor(int entityId, int i) {
|
||||
mPlayer.get(entityId).data.storeToCursor(i);
|
||||
}
|
||||
|
||||
public void cursorToStore(int entityId, int storeLoc, int x, int y) {
|
||||
StoreLoc s = StoreLoc.valueOf(storeLoc);
|
||||
mPlayer.get(entityId).data.cursorToStore(s, x, y);
|
||||
}
|
||||
|
||||
public void swapStoreItem(int entityId, int i, int storeLoc, int x, int y) {
|
||||
StoreLoc s = StoreLoc.valueOf(storeLoc);
|
||||
mPlayer.get(entityId).data.swapStoreItem(i, s, x, y);
|
||||
}
|
||||
|
||||
public void bodyToCursor(int entityId, int bodyLoc, boolean merc) {
|
||||
BodyLoc b = BodyLoc.valueOf(bodyLoc);
|
||||
mPlayer.get(entityId).data.bodyToCursor(b, merc);
|
||||
}
|
||||
|
||||
public void cursorToBody(int entityId, int bodyLoc, boolean merc) {
|
||||
BodyLoc b = BodyLoc.valueOf(bodyLoc);
|
||||
mPlayer.get(entityId).data.cursorToBody(b, merc);
|
||||
}
|
||||
|
||||
public void swapBodyItem(int entityId, int bodyLoc, boolean merc) {
|
||||
BodyLoc b = BodyLoc.valueOf(bodyLoc);
|
||||
mPlayer.get(entityId).data.swapBodyItem(b, merc);
|
||||
}
|
||||
|
||||
public void beltToCursor(int entityId, int i) {
|
||||
mPlayer.get(entityId).data.beltToCursor(i);
|
||||
}
|
||||
|
||||
public void cursorToBelt(int entityId, int x, int y) {
|
||||
mPlayer.get(entityId).data.cursorToBelt(x, y);
|
||||
}
|
||||
|
||||
public void swapBeltItem(int entityId, int i) {
|
||||
mPlayer.get(entityId).data.swapBeltItem(i);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user