<NME> CagedAnimal.java
<BEF> package com.planet_ink.coffee_mud.Items.interfaces;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Commands.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;

/*
   Copyright 2003-2022 Bo Zimmerman

   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.
*/
public interface CagedAnimal extends Item
{
	public static final int ABILITY_MOBONPICKUP=0;
	public static final int ABILITY_MOBPROGRAMMATICALLY=1;

	public boolean cageMe(MOB M);
	public MOB unCageMe();
	public String cageText();
	public void setCageText(String text);
}

<MSG> Commenting more Item interfaces.

git-svn-id: 0cdf8356e41b2d8ccbb41bb76c82068fe80b2514@13016 0d6f1817-ed0e-0410-87c9-987e46238f29

<DFF> @@ -30,13 +30,67 @@ import com.planet_ink.coffee_mud.Races.interfaces.*;
    See the License for the specific language governing permissions and
    limitations under the License.
 */
+/**
+ * Represents a MOB being stored as an Item, such as a mob in a cage, or a baby.
+ * This interface allows the mob to be converted to the item, and back again.
+ * @author Bo Zimmerman
+ */
 public interface CagedAnimal extends Item
 {
-	public static final int ABILITY_MOBONPICKUP=0;
-	public static final int ABILITY_MOBPROGRAMMATICALLY=1;
+	/**
+	 * A Cage flag bit mask denoting that this caged animal should
+	 * not automatically uncage itself, but may only do so programmatically.
+	 * A Baby, who is uncaged only through aging, is the classic example.
+	 * @see CagedAnimal#setCageFlagsBitmap(int)
+	 * @see CagedAnimal#getCageFlagsBitmap()
+	 */
+	public static final int CAGEFLAG_TO_MOB_PROGRAMMATICALLY=1;
 
+	/**
+	 * Cages the given mob, storing it in this Item object for
+	 * uncaging later.  The mob must not be bound to a session.
+	 * Does not otherwise affect the mob.
+	 * @see CagedAnimal#unCageMe()
+	 * @param M the mob to cage
+	 * @return true if the caging was successful, false otherwise
+	 */
 	public boolean cageMe(MOB M);
+
+	/**
+	 * Uncages the mob previously stored in this item by returning the mob
+	 * stored in this item.  Does not otherwise affect the item.
+	 * @see CagedAnimal#cageMe(MOB)
+	 * @return the mob stored in this item, or null if a failure
+	 */
 	public MOB unCageMe();
+
+	/**
+	 * Returns the raw xml text representing the mob stored in this item.
+	 * @see CagedAnimal#setCageText(String)
+	 * @return the raw xml text representing the mob stored in this item.
+	 */
 	public String cageText();
+
+	/**
+	 * Sets the raw xml text representing the mob stored in this item.
+	 * @see CagedAnimal#cageText()
+	 * @param text the raw xml text representing the mob stored in this item.
+	 */
 	public void setCageText(String text);
+
+	/**
+	 * Returns the flag bitmap describing how this item behaves.
+	 * @see CagedAnimal#CAGEFLAG_TO_MOB_PROGRAMMATICALLY
+	 * @see CagedAnimal#setCageFlagsBitmap(int)
+	 * @return  the flag bitmap describing how this item behaves.
+	 */
+	public int getCageFlagsBitmap();
+
+	/**
+	 * Sets the flag bitmap describing how this item behaves.
+	 * @see CagedAnimal#CAGEFLAG_TO_MOB_PROGRAMMATICALLY
+	 * @see CagedAnimal#getCageFlagsBitmap()
+	 * @return  the flag bitmap describing how this item behaves.
+	 */
+	public void setCageFlagsBitmap(int bitmap);
 }

{'commit': 'diff --git a/com/planet_ink/coffee_mud/Abilities/Misc/Pregnancy.java b/com/planet_ink/coffee_mud/Abilities/Misc/Pregnancy.java\nindex eb64862d10..8dec6873f1 100644\n--- a/com/planet_ink/coffee_mud/Abilities/Misc/Pregnancy.java\n+++ b/com/planet_ink/coffee_mud/Abilities/Misc/Pregnancy.java\n@@ -333,7 +333,7 @@ public class Pregnancy extends StdAbility implements HealthCondition\n \t\t\t\t\t\t\tbabe.resetToMaxState();\r\n \t\t\t\t\t\t\tfinal Item I=CMClass.getItem("GenCaged");\r\n \t\t\t\t\t\t\t((CagedAnimal)I).cageMe(babe);\r\n-\t\t\t\t\t\t\tI.basePhyStats().setAbility(CagedAnimal.ABILITY_MOBPROGRAMMATICALLY);\r\n+\t\t\t\t\t\t\t((CagedAnimal)I).setCageFlagsBitmap(CagedAnimal.CAGEFLAG_TO_MOB_PROGRAMMATICALLY);\r\n \t\t\t\t\t\t\tif(AGE != null)\r\n \t\t\t\t\t\t\t\tI.addNonUninvokableEffect((Ability)AGE.copyOf());\r\n \t\t\t\t\t\t\tname=CMLib.english().startWithAorAn(R.makeMobName((char)babe.baseCharStats().getStat(CharStats.STAT_GENDER), 1)).toLowerCase();\r\ndiff --git a/com/planet_ink/coffee_mud/Items/Basic/GenCaged.java b/com/planet_ink/coffee_mud/Items/Basic/GenCaged.java\nindex 00666607dc..8d8df7d5ba 100644\n--- a/com/planet_ink/coffee_mud/Items/Basic/GenCaged.java\n+++ b/com/planet_ink/coffee_mud/Items/Basic/GenCaged.java\n@@ -14,7 +14,6 @@ import com.planet_ink.coffee_mud.Locales.interfaces.*;\n import com.planet_ink.coffee_mud.MOBS.interfaces.*;\r\n import com.planet_ink.coffee_mud.Races.interfaces.*;\r\n \r\n-\r\n import java.util.*;\r\n \r\n import com.planet_ink.coffee_mud.Libraries.interfaces.*;\r\n@@ -89,7 +88,7 @@ public class GenCaged extends GenItem implements CagedAnimal\n \t{\r\n \t\tif((msg.amITarget(this)\r\n \t\t\t||((msg.tool()==this)&&(msg.target()==container())&&(container()!=null)))\r\n-\t\t&&((basePhyStats().ability()&ABILITY_MOBPROGRAMMATICALLY)==0)\r\n+\t\t&&((getCageFlagsBitmap()&CagedAnimal.CAGEFLAG_TO_MOB_PROGRAMMATICALLY)==0)\r\n \t\t&&((msg.targetMinor()==CMMsg.TYP_GET)||(msg.targetMinor()==CMMsg.TYP_DROP)))\r\n \t\t{\r\n \t\t\tfinal MOB M=unCageMe();\r\n@@ -148,4 +147,17 @@ public class GenCaged extends GenItem implements CagedAnimal\n \t\tsetReadableText(CMLib.xml().parseOutAngleBrackets(text));\r\n \t\tCMLib.flags().setReadable(this,false);\r\n \t}\r\n+\t\r\n+\t@Override\r\n+\tpublic int getCageFlagsBitmap()\r\n+\t{\r\n+\t\treturn basePhyStats().ability();\r\n+\t}\r\n+\r\n+\t@Override\r\n+\tpublic void setCageFlagsBitmap(int bitmap)\r\n+\t{\r\n+\t\tbasePhyStats.setAbility(bitmap);\r\n+\t\tphyStats.setAbility(bitmap);\r\n+\t}\r\n }\r\ndiff --git a/com/planet_ink/coffee_mud/Items/interfaces/Armor.java b/com/planet_ink/coffee_mud/Items/interfaces/Armor.java\nindex cfdef86d25..d6e1bbdc86 100644\n--- a/com/planet_ink/coffee_mud/Items/interfaces/Armor.java\n+++ b/com/planet_ink/coffee_mud/Items/interfaces/Armor.java\n@@ -30,18 +30,101 @@ import com.planet_ink.coffee_mud.Races.interfaces.*;\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n */\r\n+/**\r\n+ * Interface for items which are complex wearables.  \r\n+ * Since even the most basic of items can be held, most of the methods\r\n+ * that deal strictly with "Wearables" have their own interface.\r\n+ * @see Wearable\r\n+ * This leaves the Armor interface just for the more complex aspects of\r\n+ * Wearability.\r\n+ *  \r\n+ * @author Bo Zimmerman\r\n+ *\r\n+ */\r\n public interface Armor extends Item\r\n {\r\n+\t/**\r\n+\t * Description string array for the LAYERMASK_ constants, in ordinal order,\r\n+\t * as opposed to mask-value indexed.\r\n+\t * @see Armor#LAYERMASK_MULTIWEAR \r\n+\t * @see Armor#LAYERMASK_SEETHROUGH \r\n+\t */\r\n \tpublic static final String[] LAYERMASK_DESCS={"SEETHROUGH","MULTIWEAR"};\r\n+\t\r\n+\t/**\r\n+\t * Mask value for Armor which, when worn on the top layer, can be seen through.\r\n+\t * This allows the items worn at lower layers to be seen (unless they too are \r\n+\t * see-through).\r\n+\t * @see Armor#LAYERMASK_DESCS\r\n+\t * @see Armor#LAYERMASK_MULTIWEAR \r\n+\t */\r\n \tpublic static final short LAYERMASK_SEETHROUGH=(short)1;\r\n+\t\r\n+\t/**\r\n+\t * Mask value for Armor which can be worn many times at the same layer.\r\n+\t * @see Armor#LAYERMASK_DESCS\r\n+\t * @see Armor#LAYERMASK_SEETHROUGH \r\n+\t */\r\n \tpublic static final short LAYERMASK_MULTIWEAR=(short)2;\r\n+\t\r\n+\t/**\r\n+\t * Returns the layer at which this item is worn.  0 is the baseline layer, while\r\n+\t * larger than 0 is things like coats and shawls, where less than 0 are things\r\n+\t * like underwear and hose.\r\n+\t * @see Armor#setClothingLayer(short)\r\n+\t * @return the layer at which this item is worn.\r\n+\t */\r\n \tpublic short getClothingLayer();\r\n+\t\r\n+\t/**\r\n+\t * Sets the layer at which this item is worn.  0 is the baseline layer, while\r\n+\t * larger than 0 is things like coats and shawls, where less than 0 are things\r\n+\t * like underwear and hose.\r\n+\t * @see Armor#getClothingLayer()\r\n+\t * @return the layer at which this item is worn.\r\n+\t */\r\n \tpublic void setClothingLayer(short newLayer);\r\n+\t\r\n+\t/**\r\n+\t * Returns the bitmask for the several layer attribute flags.  See the flags\r\n+\t * for more information on what they do.\r\n+\t * \r\n+\t * @see Armor#setLayerAttributes(short)\r\n+\t * @see Armor#LAYERMASK_DESCS\r\n+\t * @see Armor#LAYERMASK_MULTIWEAR \r\n+\t * @see Armor#LAYERMASK_SEETHROUGH \r\n+\t * @return the bitmask for the several layer attribute flags\r\n+\t */\r\n \tpublic short getLayerAttributes();\r\n+\t\r\n+\t/**\r\n+\t * Sets the bitmask for the several layer attribute flags.  See the flags\r\n+\t * for more information on what they do.\r\n+\t * \r\n+\t * @see Armor#getLayerAttributes()\r\n+\t * @see Armor#LAYERMASK_DESCS\r\n+\t * @see Armor#LAYERMASK_MULTIWEAR \r\n+\t * @see Armor#LAYERMASK_SEETHROUGH \r\n+\t * @param newAttributes the bitmask for the several layer attribute flags\r\n+\t */\r\n \tpublic void setLayerAttributes(short newAttributes);\r\n \t\r\n+\t/**\r\n+\t * Returns a coded description of how well this item fits on the\r\n+\t * given mob.  See the SizeDeviation object for more information\r\n+\t * on the responses.\r\n+\t * @see SizeDeviation\r\n+\t * @param mob the mob to compare the fittability of this armor to\r\n+\t * @return a coded description of how well this item fits\r\n+\t */\r\n \tpublic SizeDeviation getSizingDeviation(MOB mob);\r\n \t\r\n+\t/**\r\n+\t * Different ways in which a piece of armor can fit, or not\r\n+\t * fit, on a mob.\r\n+\t * @see Armor#getSizingDeviation(MOB)\r\n+\t * @author Bo Zimmerman\r\n+\t */\r\n \tpublic enum SizeDeviation\r\n \t{\r\n \t\tTOO_LARGE,\r\ndiff --git a/com/planet_ink/coffee_mud/Items/interfaces/CagedAnimal.java b/com/planet_ink/coffee_mud/Items/interfaces/CagedAnimal.java\nindex e821d75e06..cfdf57b9c7 100644\n--- a/com/planet_ink/coffee_mud/Items/interfaces/CagedAnimal.java\n+++ b/com/planet_ink/coffee_mud/Items/interfaces/CagedAnimal.java\n@@ -30,13 +30,67 @@ import com.planet_ink.coffee_mud.Races.interfaces.*;\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n */\r\n+/**\r\n+ * Represents a MOB being stored as an Item, such as a mob in a cage, or a baby.\r\n+ * This interface allows the mob to be converted to the item, and back again.\r\n+ * @author Bo Zimmerman\r\n+ */\r\n public interface CagedAnimal extends Item\r\n {\r\n-\tpublic static final int ABILITY_MOBONPICKUP=0;\r\n-\tpublic static final int ABILITY_MOBPROGRAMMATICALLY=1;\r\n+\t/**\r\n+\t * A Cage flag bit mask denoting that this caged animal should\r\n+\t * not automatically uncage itself, but may only do so programmatically.\r\n+\t * A Baby, who is uncaged only through aging, is the classic example.\r\n+\t * @see CagedAnimal#setCageFlagsBitmap(int)\r\n+\t * @see CagedAnimal#getCageFlagsBitmap()\r\n+\t */\r\n+\tpublic static final int CAGEFLAG_TO_MOB_PROGRAMMATICALLY=1;\r\n \r\n+\t/**\r\n+\t * Cages the given mob, storing it in this Item object for\r\n+\t * uncaging later.  The mob must not be bound to a session.\r\n+\t * Does not otherwise affect the mob.\r\n+\t * @see CagedAnimal#unCageMe()\r\n+\t * @param M the mob to cage\r\n+\t * @return true if the caging was successful, false otherwise\r\n+\t */\r\n \tpublic boolean cageMe(MOB M);\r\n+\r\n+\t/**\r\n+\t * Uncages the mob previously stored in this item by returning the mob\r\n+\t * stored in this item.  Does not otherwise affect the item.\r\n+\t * @see CagedAnimal#cageMe(MOB)\r\n+\t * @return the mob stored in this item, or null if a failure\r\n+\t */\r\n \tpublic MOB unCageMe();\r\n+\r\n+\t/**\r\n+\t * Returns the raw xml text representing the mob stored in this item.\r\n+\t * @see CagedAnimal#setCageText(String)\r\n+\t * @return the raw xml text representing the mob stored in this item.\r\n+\t */\r\n \tpublic String cageText();\r\n+\r\n+\t/**\r\n+\t * Sets the raw xml text representing the mob stored in this item.\r\n+\t * @see CagedAnimal#cageText()\r\n+\t * @param text the raw xml text representing the mob stored in this item.\r\n+\t */\r\n \tpublic void setCageText(String text);\r\n+\r\n+\t/**\r\n+\t * Returns the flag bitmap describing how this item behaves.\r\n+\t * @see CagedAnimal#CAGEFLAG_TO_MOB_PROGRAMMATICALLY\r\n+\t * @see CagedAnimal#setCageFlagsBitmap(int)\r\n+\t * @return  the flag bitmap describing how this item behaves.\r\n+\t */\r\n+\tpublic int getCageFlagsBitmap();\r\n+\r\n+\t/**\r\n+\t * Sets the flag bitmap describing how this item behaves.\r\n+\t * @see CagedAnimal#CAGEFLAG_TO_MOB_PROGRAMMATICALLY\r\n+\t * @see CagedAnimal#getCageFlagsBitmap()\r\n+\t * @return  the flag bitmap describing how this item behaves.\r\n+\t */\r\n+\tpublic void setCageFlagsBitmap(int bitmap);\r\n }\r\n', 'commit_subject': 'Commenting more Item interfaces.', 'repo_name': 'bozimmerman/CoffeeMud', 'committer': {'name': 'bozimmerman', 'email': 'dc45fe023482b3b890b5e574e53c1d051f45b1ef@zimmers.net', 'time_sec': '1442868013', 'tz_offset': '0', 'date': {'seconds': '1442868013'}}, 'commit_tree': 'f494f7b212fb157c13ae2b844a2292f1a799d741', 'commit_message': 'Commenting more Item interfaces.\n\ngit-svn-id: 0cdf8356e41b2d8ccbb41bb76c82068fe80b2514@13016 0d6f1817-ed0e-0410-87c9-987e46238f29\n', 'language_name': 'JavaScript', 'license': 'apache-2.0', 'hunks': '@@ -30,13 +30,67 @@ import com.planet_ink.coffee_mud.Races.interfaces.*;\n    See the License for the specific language governing permissions and\r\n    limitations under the License.\r\n */\r\n+/**\r\n+ * Represents a MOB being stored as an Item, such as a mob in a cage, or a baby.\r\n+ * This interface allows the mob to be converted to the item, and back again.\r\n+ * @author Bo Zimmerman\r\n+ */\r\n public interface CagedAnimal extends Item\r\n {\r\n-\tpublic static final int ABILITY_MOBONPICKUP=0;\r\n-\tpublic static final int ABILITY_MOBPROGRAMMATICALLY=1;\r\n+\t/**\r\n+\t * A Cage flag bit mask denoting that this caged animal should\r\n+\t * not automatically uncage itself, but may only do so programmatically.\r\n+\t * A Baby, who is uncaged only through aging, is the classic example.\r\n+\t * @see CagedAnimal#setCageFlagsBitmap(int)\r\n+\t * @see CagedAnimal#getCageFlagsBitmap()\r\n+\t */\r\n+\tpublic static final int CAGEFLAG_TO_MOB_PROGRAMMATICALLY=1;\r\n \r\n+\t/**\r\n+\t * Cages the given mob, storing it in this Item object for\r\n+\t * uncaging later.  The mob must not be bound to a session.\r\n+\t * Does not otherwise affect the mob.\r\n+\t * @see CagedAnimal#unCageMe()\r\n+\t * @param M the mob to cage\r\n+\t * @return true if the caging was successful, false otherwise\r\n+\t */\r\n \tpublic boolean cageMe(MOB M);\r\n+\r\n+\t/**\r\n+\t * Uncages the mob previously stored in this item by returning the mob\r\n+\t * stored in this item.  Does not otherwise affect the item.\r\n+\t * @see CagedAnimal#cageMe(MOB)\r\n+\t * @return the mob stored in this item, or null if a failure\r\n+\t */\r\n \tpublic MOB unCageMe();\r\n+\r\n+\t/**\r\n+\t * Returns the raw xml text representing the mob stored in this item.\r\n+\t * @see CagedAnimal#setCageText(String)\r\n+\t * @return the raw xml text representing the mob stored in this item.\r\n+\t */\r\n \tpublic String cageText();\r\n+\r\n+\t/**\r\n+\t * Sets the raw xml text representing the mob stored in this item.\r\n+\t * @see CagedAnimal#cageText()\r\n+\t * @param text the raw xml text representing the mob stored in this item.\r\n+\t */\r\n \tpublic void setCageText(String text);\r\n+\r\n+\t/**\r\n+\t * Returns the flag bitmap describing how this item behaves.\r\n+\t * @see CagedAnimal#CAGEFLAG_TO_MOB_PROGRAMMATICALLY\r\n+\t * @see CagedAnimal#setCageFlagsBitmap(int)\r\n+\t * @return  the flag bitmap describing how this item behaves.\r\n+\t */\r\n+\tpublic int getCageFlagsBitmap();\r\n+\r\n+\t/**\r\n+\t * Sets the flag bitmap describing how this item behaves.\r\n+\t * @see CagedAnimal#CAGEFLAG_TO_MOB_PROGRAMMATICALLY\r\n+\t * @see CagedAnimal#getCageFlagsBitmap()\r\n+\t * @return  the flag bitmap describing how this item behaves.\r\n+\t */\r\n+\tpublic void setCageFlagsBitmap(int bitmap);\r\n }\r\n', 'addition_count': 56, 'deletion_count': 2, 'src_file': 'a/com/planet_ink/coffee_mud/Items/interfaces/CagedAnimal.java', 'tgt_file': 'b/com/planet_ink/coffee_mud/Items/interfaces/CagedAnimal.java', 'file_extension': '.java', 'before_file': 'package com.planet_ink.coffee_mud.Items.interfaces;\nimport com.planet_ink.coffee_mud.core.interfaces.*;\nimport com.planet_ink.coffee_mud.core.*;\nimport com.planet_ink.coffee_mud.core.collections.*;\nimport com.planet_ink.coffee_mud.Abilities.interfaces.*;\nimport com.planet_ink.coffee_mud.Areas.interfaces.*;\nimport com.planet_ink.coffee_mud.Behaviors.interfaces.*;\nimport com.planet_ink.coffee_mud.CharClasses.interfaces.*;\nimport com.planet_ink.coffee_mud.Commands.interfaces.*;\nimport com.planet_ink.coffee_mud.Common.interfaces.*;\nimport com.planet_ink.coffee_mud.Exits.interfaces.*;\nimport com.planet_ink.coffee_mud.Items.interfaces.*;\nimport com.planet_ink.coffee_mud.Libraries.interfaces.*;\nimport com.planet_ink.coffee_mud.Locales.interfaces.*;\nimport com.planet_ink.coffee_mud.MOBS.interfaces.*;\nimport com.planet_ink.coffee_mud.Races.interfaces.*;\n\n/*\n   Copyright 2003-2022 Bo Zimmerman\n\n   Licensed under the Apache License, Version 2.0 (the "License");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n\t   http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an "AS IS" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\r\n   limitations under the License.\r\n*/\r\npublic interface CagedAnimal extends Item\r\n{\r\n\tpublic static final int ABILITY_MOBONPICKUP=0;\r\n\tpublic static final int ABILITY_MOBPROGRAMMATICALLY=1;\r\n\r\n\tpublic boolean cageMe(MOB M);\r\n\tpublic MOB unCageMe();\r\n\tpublic String cageText();\r\n\tpublic void setCageText(String text);\r\n}\r\n', 'message': 'Commenting more Item interfaces.\n\ngit-svn-id: 0cdf8356e41b2d8ccbb41bb76c82068fe80b2514@13016 0d6f1817-ed0e-0410-87c9-987e46238f29\n', 'author_name': 'bozimmerman', 'lang': 'java'}