Pārlūkot izejas kodu

BETA: Enabling some warnings and documenting few classes.
* Warning: Possible accidental boolean assignment (e.g. 'if (a = b)')
* Warning: Empty statement: When enabled, the compiler will issue an error or a warning whenever it encounters an empty statement (e.g. a superfluous semicolon).
* Config class JavaDoc.
* Minimalist L2DatabaseFactory JavaDoc.
* SkillTreesData JavaDocs.
* L2SkillOpType JavaDocs.

Zoey76 13 gadi atpakaļ
vecāks
revīzija
1e2f5bac24

+ 3 - 3
L2J_Server_BETA/.settings/org.eclipse.jdt.core.prefs

@@ -1,4 +1,4 @@
-#Tue Mar 20 12:54:53 UYT 2012
+#Wed Mar 21 09:57:03 UYT 2012
 eclipse.preferences.version=1
 org.eclipse.jdt.core.codeComplete.argumentPrefixes=
 org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -19,7 +19,7 @@ org.eclipse.jdt.core.compiler.problem.deprecation=warning
 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -58,7 +58,7 @@ org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
 org.eclipse.jdt.core.compiler.problem.nullReference=warning
 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning

+ 5 - 0
L2J_Server_BETA/java/com/l2jserver/Config.java

@@ -50,6 +50,11 @@ import com.l2jserver.gameserver.util.FloodProtectorConfig;
 import com.l2jserver.util.L2Properties;
 import com.l2jserver.util.StringUtil;
 
+/**
+ * This class loads all the game server related configurations from files.<br>
+ * The files are usually located in game/config folder in game server's root folder.<br>
+ * Each configuration has a default value (that should reflect retail behavior).
+ */
 public final class Config
 {
 	protected static final Logger _log = Logger.getLogger(Config.class.getName());

+ 3 - 0
L2J_Server_BETA/java/com/l2jserver/L2DatabaseFactory.java

@@ -25,6 +25,9 @@ import java.util.logging.Logger;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.mchange.v2.c3p0.ComboPooledDataSource;
 
+/**
+ * This class manages the database connections.<br>
+ */
 public class L2DatabaseFactory
 {
 	private static final Logger _log = Logger.getLogger(L2DatabaseFactory.class.getName());

+ 26 - 2
L2J_Server_BETA/java/com/l2jserver/gameserver/datatables/SkillTreesData.java

@@ -45,6 +45,24 @@ import com.l2jserver.gameserver.util.Util;
 import com.l2jserver.util.file.filter.XMLFilter;
 
 /**
+ * This class loads and manage the characters and pledges skills trees.<br>
+ * Here can be found the following skill trees:<br>
+ * <ul>
+ * <li>Class skill trees: player skill trees for each class.</li>
+ * <li>Transfer skill trees: player skill trees for each healer class.</lI>
+ * <li>Collect skill tree: player skill tree for Gracia related skills.</li>
+ * <li>Fishing skill tree: player skill tree for fishing related skills.</li>
+ * <li>Transform skill tree: player skill tree for transformation related skills.</li>
+ * <li>Sub-Class skill tree: player skill tree for sub-class related skills.</li>
+ * <li>Noble skill tree: player skill tree for noblesse related skills.</li>
+ * <li>Hero skill tree: player skill tree for heroes related skills.</li>
+ * <li>GM skill tree: player skill tree for Game Master related skills.</li>
+ * <li>Common skill tree: custom skill tree for players, skills in this skill tree will be available for all players.</li>
+ * <li>Pledge skill tree: clan skill tree for main clan.</li>
+ * <li>Sub-Pledge skill tree: clan skill tree for sub-clans.<li>
+ * </ul>
+ * For easy customization of player class skill trees, the parent Id of each class is taken from the XML data, this means you can use a different class parent Id than in the normal game play, for example all 3rd class dagger users will have Treasure Hunter skills as 1st and 2nd class skills.<br>
+ * For XML schema please refer to skillTrees.xsd in datapack in xsd folder and for parameters documentation refer to documentation.txt in skillTrees folder.<br>
  * @author Zoey76
  */
 public final class SkillTreesData
@@ -85,6 +103,9 @@ public final class SkillTreesData
 		load();
 	}
 	
+	/**
+	 * Wrapper for required actions to clear and load all skill trees.
+	 */
 	public void load()
 	{
 		_loading = true;
@@ -157,7 +178,7 @@ public final class SkillTreesData
 	}
 	
 	/**
-	 * Loads all files type xml from data/skillTrees/ and call the parser for each one of them.
+	 * Loads all files type XML from data/skillTrees/ and call the parser for each one of them.
 	 * @return {@code false} when the files are loaded.
 	 */
 	private boolean loadFiles()
@@ -178,7 +199,7 @@ public final class SkillTreesData
 	
 	/**
 	 * Parse a skill tree file and store it into the correct skill tree.
-	 * @param file the xml file to be parsed.
+	 * @param file the XML file to be parsed.
 	 */
 	private void loadSkillTree(File file)
 	{
@@ -1385,6 +1406,9 @@ public final class SkillTreesData
 		return false;
 	}
 	
+	/**
+	 * @return the only instance of this class.
+	 */
 	public static SkillTreesData getInstance()
 	{
 		return SingletonHolder._instance;

+ 49 - 11
L2J_Server_BETA/java/com/l2jserver/gameserver/model/skills/L2SkillOpType.java

@@ -15,33 +15,71 @@
 package com.l2jserver.gameserver.model.skills;
 
 /**
- * Documentation:<br>
  * This enum class holds the skill operative types:
  * <ul>
- * 	<li>A1 = Active Skill with "Instant Effect" (for example damage skills heal/pdam/mdam/cpdam skills).</li>
- * 	<li>A2 = Active Skill with "Continuous effect + Instant effect" (for example buff/debuff or damage/heal over time skills).</li>
- * 	<li>A3 = Active Skill with "Instant effect + Continuous effect"</li>
- * 	<li>A4 = Active Skill with "Instant effect + ?" used for special event herb.</li>
- * 	<li>CA1 = Continuous Active Skill with "instant effect" (instant effect casted by ticks).</li>
- * 	<li>CA5 = Continuous Active Skill with "continuous effect" (continuous effect casted by ticks).</li>
- * 	<li>DA1 = Directional Active Skill with "Charge/Rush instant effect"</li>
- * 	<li>DA2 = Directional Active Skill with "Charge/Rush Continuous effect"</li>
- * 	<li>P = Passive Skill</li>
- * 	<li>T = Toggle Skill</li>
+ * <li>A1</li>
+ * <li>A2</li>
+ * <li>A3</li>
+ * <li>A4</li>
+ * <li>CA1</li>
+ * <li>CA5</li>
+ * <li>DA1</li>
+ * <li>DA2</li>
+ * <li>P</li>
+ * <li>T</li>
  * </ul>
  * @author Zoey76
  */
 public enum L2SkillOpType
 {
+	/**
+	 * Active Skill with "Instant Effect" (for example damage skills heal/pdam/mdam/cpdam skills).
+	 */
 	A1,
+	
+	/**
+	 * Active Skill with "Continuous effect + Instant effect" (for example buff/debuff or damage/heal over time skills).
+	 */
 	A2,
+	
+	/**
+	 * Active Skill with "Instant effect + Continuous effect"
+	 */
 	A3,
+	
+	/**
+	 * Active Skill with "Instant effect + ?" used for special event herb.
+	 */
 	A4,
+	
+	/**
+	 * Continuous Active Skill with "instant effect" (instant effect casted by ticks).
+	 */
 	CA1,
+	
+	/**
+	 * Continuous Active Skill with "continuous effect" (continuous effect casted by ticks).
+	 */
 	CA5,
+	
+	/**
+	 * Directional Active Skill with "Charge/Rush instant effect".
+	 */
 	DA1,
+	
+	/**
+	 * Directional Active Skill with "Charge/Rush Continuous effect".
+	 */
 	DA2,
+	
+	/**
+	 * Passive Skill.
+	 */
 	P,
+	
+	/**
+	 * Toggle Skill.
+	 */
 	T;
 	
 	/**