1 /* $Id$ */
2 /***************************************************************************
3  *                      (C) Copyright 2003 - Marauroa                      *
4  ***************************************************************************
5  ***************************************************************************
6  *                                                                         *
7  *   This program is free software; you can redistribute it and/or modify  *
8  *   it under the terms of the GNU General Public License as published by  *
9  *   the Free Software Foundation; either version 2 of the License, or     *
10  *   (at your option) any later version.                                   *
11  *                                                                         *
12  ***************************************************************************/
13 package games.stendhal.client.entity;
14 
15 import marauroa.common.game.RPObject;
16 import marauroa.common.game.RPSlot;
17 
18 public class Item extends Entity {
19 	/**
20 	 * The content slot, or <code>null</code> if the item has none or it's not
21 	 * accessible.
22 	 */
23 	private RPSlot content;
24 
25 	/**
26 	 * Initialize this entity for an object.
27 	 *
28 	 * @param object
29 	 *            The object.
30 	 *
31 	 * @see #release()
32 	 */
33 	@Override
initialize(final RPObject object)34 	public void initialize(final RPObject object) {
35 		super.initialize(object);
36 
37 		if (object.hasSlot("content")) {
38 			content = object.getSlot("content");
39 		} else {
40 			content = null;
41 		}
42 	}
43 
44 	/**
45 	 * Get the content slot.
46 	 *
47 	 * @return Content slot or <code>null</code> if the item has none or it's
48 	 * not accessible.
49 	 */
getContent()50 	public RPSlot getContent() {
51 		return content;
52 	}
53 }
54