package gameEngine.simulator.interfaces; import gameEngine.entites.gameComponents.Mesh; import gameEngine.views.Sprite; import models.algebra.Expression; import models.algebra.Term; import simulator.Event; import simulator.SystemState; import simulator.interfaces.INativeReceiver; public class SpriteReceiver implements INativeReceiver { private Mesh mesh; public SpriteReceiver(Mesh mesh) { this.mesh = mesh; } @Override public void onReceiveFromModel(Event event, SystemState nextSystemState) { Expression message = event.getMessage(); if (message instanceof Term) { Expression exp = ((Term) message).getChild(0); mesh.setSprite(exp.toString()); } } }