/* $Id: Corpse.java,v 1.72 2010/03/29 21:21:22 nhnb Exp $ */
/***************************************************************************
* (C) Copyright 2003 - Marauroa *
***************************************************************************
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
package games.stendhal.client.entity;
//
//
import marauroa.common.game.RPObject;
import marauroa.common.game.RPSlot;
/**
* A corpse entity.
*/
public class Corpse extends Entity {
/**
* Content property.
*/
public static final Property PROP_CONTENT = new Property();
/**
* The current content slot.
*/
private RPSlot content;
//
// Corpse
//
/**
* Get the corpse contents.
*
* @return The contents slot.
*/
public RPSlot getContent() {
return content;
}
//
// Entity
//
/**
* Initialize this entity for an object.
*
* @param object
* The object.
*
* @see #release()
*/
@Override
public void initialize(final RPObject object) {
super.initialize(object);
if (object.hasSlot("content")) {
content = object.getSlot("content");
} else {
content = null;
}
}
//
// RPObjectChangeListener
//
/**
* The object added/changed attribute(s).
*
* @param object
* The base object.
* @param changes
* The changes.
*/
@Override
public void onChangedAdded(final RPObject object, final RPObject changes) {
super.onChangedAdded(object, changes);
if (changes.hasSlot("content")) {
fireChange(PROP_CONTENT);
}
}
}
|