package io.luna.game.event.impl;

import io.luna.game.event.Event;
import io.luna.game.model.Entity;
import io.luna.game.model.mob.Mob;
import io.luna.game.model.mob.Npc;
import io.luna.game.model.mob.Player;
import io.luna.game.model.object.GameObject;

/**
 * An entity-based event. Not intended for interception.
 *
 * @author lare96 <http://github.org/lare96>
 */
class EntityEvent extends Event {

    /**
     * The entity.
     */
    protected final Entity entity;

    /**
     * Creates a new {@link MobEvent}.
     *
     * @param entity The entity.
     */
    public EntityEvent(Entity entity) {
        this.entity = entity;
    }

    /* TODO: add item method, once they're implemented. */

    /**
     * @return The entity.
     */
    public Entity entity() {
        return entity;
    }

    /**
     * Returns the entity as a mob.
     */
    public Mob asMob() {
        return (Mob) entity;
    }

    /**
     * Returns the entity as a non-player.
     */
    public Npc asNpc() {
        return (Npc) entity;
    }

    /**
     * Returns the entity as a player.
     */
    public Player asPlr() {
        return (Player) entity;
    }

    /**
     * Returns the entity as an object.
     */
    public GameObject asObject() {
        return (GameObject) entity;
    }
}
@@ -94,16 +94,59 @@
 Entity;%0A
+import io.luna.game.model.item.GroundItem;%0A
 import i
@@ -172,16 +172,16 @@
 ob.Mob;%0A
-
 import i
@@ -686,68 +686,8 @@
  %7D%0A%0A
-    /* TODO: add item method, once they're implemented. */%0A%0A
     
@@ -1226,24 +1226,24 @@
 sObject() %7B%0A
-
         retu
@@ -1271,10 +1271,146 @@
 y;%0A    %7D
+%0A%0A    /**%0A     * Returns the entity as a ground item.%0A     */%0A    public GroundItem asItem() %7B%0A        return (GroundItem) entity;%0A    %7D
 %0A%7D

Remove TODO