Created ItemManager system to interface char data item events with engine

This commit is contained in:
Collin Smith 2020-05-30 16:17:50 -07:00
parent e1443d0acf
commit c6468eb788

View 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);
}
}