Forráskód Böngészése

BETA: !JavaDocs improvements.

Patch by: jurchiks
Zoey76 11 éve
szülő
commit
9185309f10

+ 2 - 16
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/ItemTable.java

@@ -36,7 +36,6 @@ import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.engines.DocumentEngine;
-import com.l2jserver.gameserver.engines.items.Item;
 import com.l2jserver.gameserver.enums.ItemLocation;
 import com.l2jserver.gameserver.idfactory.IdFactory;
 import com.l2jserver.gameserver.model.L2Object;
@@ -56,8 +55,7 @@ import com.l2jserver.gameserver.scripting.scriptengine.listeners.player.NewItemL
 import com.l2jserver.gameserver.util.GMAudit;
 
 /**
- * This class ...
- * @version $Revision: 1.9.2.6.2.9 $ $Date: 2005/04/02 15:57:34 $
+ * This class serves as a container for all item templates in the game.
  */
 public class ItemTable
 {
@@ -169,25 +167,13 @@ public class ItemTable
 	}
 	
 	/**
-	 * Returns instance of ItemTable
-	 * @return ItemTable
+	 * @return a reference to this ItemTable object
 	 */
 	public static ItemTable getInstance()
 	{
 		return SingletonHolder._instance;
 	}
 	
-	/**
-	 * @return a new object Item
-	 */
-	public Item newItem()
-	{
-		return new Item();
-	}
-	
-	/**
-	 * Constructor.
-	 */
 	protected ItemTable()
 	{
 		_etcItems = new FastMap<>();

+ 12 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/holders/ItemChanceHolder.java

@@ -19,7 +19,8 @@
 package com.l2jserver.gameserver.model.holders;
 
 /**
- * Item holder, with additional parameter chance.
+ * A DTO for items; contains item ID, count and chance.<br>
+ * Complemented by {@link QuestItemHolder}.
  * @author xban1x
  */
 public class ItemChanceHolder extends ItemHolder
@@ -37,8 +38,18 @@ public class ItemChanceHolder extends ItemHolder
 		_chance = chance;
 	}
 	
+	/**
+	 * Gets the cahnce.
+	 * @return the drop chance of the item contained in this object
+	 */
 	public double getChance()
 	{
 		return _chance;
 	}
+	
+	@Override
+	public String toString()
+	{
+		return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", chance: " + _chance;
+	}
 }

+ 5 - 4
L2J_Server_BETA/java/com/l2jserver/gameserver/model/holders/ItemHolder.java

@@ -21,7 +21,8 @@ package com.l2jserver.gameserver.model.holders;
 import com.l2jserver.gameserver.model.interfaces.IIdentifiable;
 
 /**
- * Holder for item id and count.
+ * A simple DTO for items; contains item ID and count.<br>
+ * Extended by {@link ItemChanceHolder}, {@link QuestItemHolder}, {@link UniqueItemHolder}.
  * @author UnAfraid
  */
 public class ItemHolder implements IIdentifiable
@@ -36,7 +37,7 @@ public class ItemHolder implements IIdentifiable
 	}
 	
 	/**
-	 * @return the item/object identifier.
+	 * @return the ID of the item contained in this object
 	 */
 	@Override
 	public int getId()
@@ -45,7 +46,7 @@ public class ItemHolder implements IIdentifiable
 	}
 	
 	/**
-	 * @return the item count.
+	 * @return the count of items contained in this object
 	 */
 	public long getCount()
 	{
@@ -55,6 +56,6 @@ public class ItemHolder implements IIdentifiable
 	@Override
 	public String toString()
 	{
-		return getClass().getSimpleName() + ": Id: " + _id + " Count: " + _count;
+		return "[" + getClass().getSimpleName() + "] ID: " + _id + ", count: " + _count;
 	}
 }

+ 12 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/holders/QuestItemHolder.java

@@ -19,7 +19,8 @@
 package com.l2jserver.gameserver.model.holders;
 
 /**
- * Item Holder storing chance in addition for quests.
+ * A DTO for items; contains item ID, count and chance.<br>
+ * Complemented by {@link ItemChanceHolder}.
  * @author xban1x
  */
 public class QuestItemHolder extends ItemHolder
@@ -37,8 +38,18 @@ public class QuestItemHolder extends ItemHolder
 		_chance = chance;
 	}
 	
+	/**
+	 * Gets the chance.
+	 * @return the drop chance of the item contained in this object
+	 */
 	public int getChance()
 	{
 		return _chance;
 	}
+	
+	@Override
+	public String toString()
+	{
+		return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", count: " + getCount() + ", chance: " + _chance;
+	}
 }

+ 7 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/holders/UniqueItemHolder.java

@@ -21,7 +21,7 @@ package com.l2jserver.gameserver.model.holders;
 import com.l2jserver.gameserver.model.interfaces.IUniqueId;
 
 /**
- * Unique object id item holder.
+ * A DTO for items; contains item ID, object ID and count.
  * @author xban1x
  */
 public final class UniqueItemHolder extends ItemHolder implements IUniqueId
@@ -44,4 +44,10 @@ public final class UniqueItemHolder extends ItemHolder implements IUniqueId
 	{
 		return _objectId;
 	}
+	
+	@Override
+	public String toString()
+	{
+		return "[" + getClass().getSimpleName() + "] ID: " + getId() + ", object ID: " + _objectId + ", count: " + getCount();
+	}
 }

+ 25 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/interfaces/ILocational.java

@@ -19,20 +19,44 @@
 package com.l2jserver.gameserver.model.interfaces;
 
 /**
- * Simple interface for location of object.
+ * Object world location storage interface.
  * @author xban1x
  */
 public interface ILocational
 {
+	/**
+	 * Gets the X coordinate of this object.
+	 * @return the X coordinate
+	 */
 	public int getX();
 	
+	/**
+	 * Gets the Y coordinate of this object.
+	 * @return the current Y coordinate
+	 */
 	public int getY();
 	
+	/**
+	 * Gets the Z coordinate of this object.
+	 * @return the current Z coordinate
+	 */
 	public int getZ();
 	
+	/**
+	 * Gets the heading of this object.
+	 * @return the current heading
+	 */
 	public int getHeading();
 	
+	/**
+	 * Gets the instance zone ID of this object.
+	 * @return the ID of the instance zone this object is currently in (0 - not in any instance)
+	 */
 	public int getInstanceId();
 	
+	/**
+	 * Gets this object's location.
+	 * @return a {@link ILocational} object containing the current position of this object
+	 */
 	public ILocational getLocation();
 }

+ 35 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/interfaces/IPositionable.java

@@ -21,24 +21,58 @@ package com.l2jserver.gameserver.model.interfaces;
 import com.l2jserver.gameserver.model.Location;
 
 /**
- * Interface for changing location of object.
+ * Object world location storage and update interface.
  * @author Zoey76
  */
 public interface IPositionable extends ILocational
 {
+	/**
+	 * Sets the X coordinate of this object.
+	 * @param x the new X coordinate
+	 */
 	public void setX(int x);
 	
+	/**
+	 * Sets the Y coordinate of this object.
+	 * @param y the new Y coordinate
+	 */
 	public void setY(int y);
 	
+	/**
+	 * Sets the Z coordinate of this object.
+	 * @param z the new Z coordinate
+	 */
 	public void setZ(int z);
 	
+	/**
+	 * Sets all three coordinates of this object.
+	 * @param x the new X coordinate
+	 * @param y the new Y coordinate
+	 * @param z the new Z coordinate
+	 */
 	public void setXYZ(int x, int y, int z);
 	
+	/**
+	 * Sets all three coordinates of this object.
+	 * @param loc the object whose coordinates to use
+	 */
 	public void setXYZ(ILocational loc);
 	
+	/**
+	 * Sets the heading of this object.
+	 * @param heading the new heading
+	 */
 	public void setHeading(int heading);
 	
+	/**
+	 * Changes the instance zone ID of this object.
+	 * @param instanceId the ID of the instance zone to put this object in (0 - not in any instance)
+	 */
 	public void setInstanceId(int instanceId);
 	
+	/**
+	 * Changes the location of this object.
+	 * @param loc the new location
+	 */
 	public void setLocation(Location loc);
 }

+ 1 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/quest/Quest.java

@@ -167,7 +167,7 @@ public class Quest extends ManagedScript implements IIdentifiable
 		{
 			QuestManager.getInstance().addScript(this);
 		}
- 		
+		
 		loadGlobalData();
 	}