Beispiel #1
0
 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);
 }
Beispiel #2
0
 public void onPost(Post post)
 {
     switch(post.category)
     {
         case PostCategory.PLACED_OBJECT:
         case PostCategory.REMOVED_OBJECT:
             tmp = post.targetEntity;
             search = true;
             break;
         default:
             break;
     }
 }
Beispiel #3
0
 public void postMessage(Post post)
 {
     Console.WriteLine("Recieved post: " + post.category);
     onPost_(post);
 }