Skip to content

Commit

Permalink
Remueve artemis-fluid de ServerNotificationProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
cpbeto committed Apr 17, 2022
1 parent d405233 commit 41ba070
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package server.systems.network;

import com.artemis.E;
import com.artemis.annotations.Wire;
import com.artemis.ComponentMapper;
import component.entity.character.info.Bag;
import server.systems.config.ObjectSystem;
import server.systems.world.WorldEntitiesSystem;
Expand All @@ -11,9 +10,6 @@
import shared.network.inventory.InventoryUpdate;
import shared.network.notifications.EntityUpdate;

import static com.artemis.E.E;

@Wire
public class ServerNotificationProcessor extends DefaultNotificationProcessor {

private WorldEntitiesSystem worldEntitiesSystem;
Expand All @@ -22,15 +18,17 @@ public class ServerNotificationProcessor extends DefaultNotificationProcessor {
private ServerSystem networkManager;
private EntityUpdateSystem entityUpdateSystem;

ComponentMapper<Bag> mBag;

@Override
public void processNotification(EntityUpdate entityUpdate) {
entityUpdateSystem.add(entityUpdate, UpdateTo.NEAR);
}

@Override
public void processNotification(InventoryUpdate inventoryUpdate) {
E player = E(inventoryUpdate.getId());
Bag bag = player.getBag();
int entityId = inventoryUpdate.getId();
Bag bag = mBag.create(entityId);
inventoryUpdate.getUpdates().forEach(bag::set);
}

Expand Down

0 comments on commit 41ba070

Please sign in to comment.