public override void onPost(Post post) { switch (post.category) { case PostCategory.INV_SLOT: InventoryComponent inv = (InventoryComponent)post.component; GameEntity item = inv.getItem(post.slot); if (item != null) { if (item.item.number_ > 1 && Locator.getInputHandler().isKeyDown(Keys.LeftShift)) { item.item.number_--; item = Locator.getObjectFactory().createItem(item.item); inv.onUpdate(); changeState(new HoldingItem(inv, item, post.slot)); } else { inv.takeItem(post.slot); changeState(new HoldingItem(inv, item, post.slot)); } } break; default: break; } base.onPost(post); }
public void onPost(Post post) { switch(post.category) { case PostCategory.PLACED_OBJECT: case PostCategory.REMOVED_OBJECT: tmp = post.targetEntity; search = true; break; default: break; } }
public void postMessage(Post post) { Console.WriteLine("Recieved post: " + post.category); onPost_(post); }