[mud4j-commit] SF.net SVN: mud4j: [55] trunk/mud4j-core/src/java/net/sf/mud4j/world/item/ AbstractI
Status: Pre-Alpha
Brought to you by:
mpurland
From: <mpu...@us...> - 2006-12-24 18:06:15
|
Revision: 55 http://mud4j.svn.sourceforge.net/mud4j/?rev=55&view=rev Author: mpurland Date: 2006-12-24 10:06:13 -0800 (Sun, 24 Dec 2006) Log Message: ----------- Add abstract implementation of Item interface. Added Paths: ----------- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItem.java Added: trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItem.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItem.java (rev 0) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItem.java 2006-12-24 18:06:13 UTC (rev 55) @@ -0,0 +1,73 @@ +/** + * Copyright 2006 Matthew Purland (m.p...@gm...) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package net.sf.mud4j.world.item; + +import java.util.ArrayList; +import java.util.List; + +import net.sf.mud4j.effect.EffectBehavior; + +/** + * Abstract implementation for an item type. + * + * @author Matthew Purland + */ +public class AbstractItem implements Item { + + private String itemName; + + // List of item types + private List<ItemType> itemTypes = new ArrayList<ItemType>(); + + // Effect behavior for item effects + private EffectBehavior effectBehavior; + + /** + * {@inheritDoc} + */ + public String getName() { + return itemName; + } + + /** + * {@inheritDoc} + */ + public void setName(String newItemName) { + this.itemName = newItemName; + } + + /** + * {@inheritDoc} + */ + public List<ItemType> getTypes() { + return itemTypes; + } + + /** + * {@inheritDoc} + */ + public EffectBehavior getEffectBehavior() { + return effectBehavior; + } + + /** + * {@inheritDoc} + */ + public void setEffectBehavior(EffectBehavior effectBehavior) { + this.effectBehavior = effectBehavior; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |