mud4j-commit Mailing List for mud4j (Page 2)
Status: Pre-Alpha
Brought to you by:
mpurland
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(57) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(31) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(20) |
Jul
|
Aug
|
Sep
(1) |
Oct
(14) |
Nov
(2) |
Dec
|
2008 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mpu...@us...> - 2007-06-03 01:53:23
|
Revision: 136 http://mud4j.svn.sourceforge.net/mud4j/?rev=136&view=rev Author: mpurland Date: 2007-06-02 18:53:22 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc param. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/damage/Damageable.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/damage/Damageable.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/damage/Damageable.java 2007-06-03 01:44:37 UTC (rev 135) +++ trunk/mud4j-core/src/java/net/sf/mud4j/damage/Damageable.java 2007-06-03 01:53:22 UTC (rev 136) @@ -38,7 +38,7 @@ /** * Sets the damage behavior for the damageable object. * - * @param behavior DamageBehavior behavior object to set. + * @param damageBehavior DamageBehavior behavior object to set. */ public void setDamageBehavior(DamageBehavior damageBehavior); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:44:39
|
Revision: 135 http://mud4j.svn.sourceforge.net/mud4j/?rev=135&view=rev Author: mpurland Date: 2007-06-02 18:44:37 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc, format, add source and target locations, and add move method to move to the target location. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/Direction.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/Direction.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/Direction.java 2007-06-03 01:38:24 UTC (rev 134) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/Direction.java 2007-06-03 01:44:37 UTC (rev 135) @@ -17,27 +17,75 @@ package net.sf.mud4j.world; /** - * Direction to define different directions for dynamic - * direction management to add west, east, north, south, etc... + * Direction to define different directions for dynamic direction management to + * add west, east, north, south, etc... * * @author Matthew Purland */ public class Direction { - + private String directionName; - + /** + * Direction is from source to target location. Example. If direction is + * east then Source (east to) --> Target + */ + private TileLocation sourceLocation; + private TileLocation targetLocation; + + /** * Creates a direction with a name such as "north" or "south". + * * @param directionName Name of the direction. + * @param sourceLocation Source of the location to the target + * @param targetLocation Target of the location from the source */ - public Direction(String directionName) { + public Direction(String directionName, TileLocation sourceLocation, + TileLocation targetLocation) { this.directionName = directionName; + this.sourceLocation = sourceLocation; + this.targetLocation = targetLocation; } - + /** * Get name of direction. */ public String getDirectionName() { return directionName; } + + /** + * Get the source location. + * + * @return the source location. + */ + public TileLocation getSourceLocation() { + return this.sourceLocation; + } + + /** + * Get the target location. + * + * @return the target location. + */ + public TileLocation getTargetLocation() { + return this.targetLocation; + } + + /** + * Move the given placeable to the target location of the direction. + * + * @param placeable Placeable to place within the target location. + * @throws IllegalArgumentException when the given placeable is not in the + * source location. + */ + public void move(Placeable placeable) throws IllegalArgumentException { + if (!placeable.getCurrentLocation().equals(getSourceLocation())) { + throw new IllegalArgumentException("Could not place placeable (" + + placeable + + ") because it is not currently in the source location."); + } + + placeable.place(targetLocation); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:38:39
|
Revision: 134 http://mud4j.svn.sourceforge.net/mud4j/?rev=134&view=rev Author: mpurland Date: 2007-06-02 18:38:24 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add getCurrentLocation method. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/Placeable.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/Placeable.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/Placeable.java 2007-06-03 01:31:19 UTC (rev 133) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/Placeable.java 2007-06-03 01:38:24 UTC (rev 134) @@ -16,20 +16,26 @@ package net.sf.mud4j.world; - /** - * Any object that implements this interface will - * be placeable within a {@link Location}. + * Any object that implements this interface will be placeable within a + * {@link Location}. * * @author Matthew Purland - * * @see Location */ public interface Placeable { /** * Move the placeable object to a location. + * * @param to Location to move to. */ - public void place(Location to); + void place(Location to); + + /** + * Get the current location of the placeable. + * + * @return The current location + */ + Location getCurrentLocation(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:31:38
|
Revision: 133 http://mud4j.svn.sourceforge.net/mud4j/?rev=133&view=rev Author: mpurland Date: 2007-06-02 18:31:19 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add class comment. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/AbstractWorld.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/AbstractWorld.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/AbstractWorld.java 2007-06-03 01:29:23 UTC (rev 132) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/AbstractWorld.java 2007-06-03 01:31:19 UTC (rev 133) @@ -21,19 +21,20 @@ import net.sf.mud4j.world.area.Area; /** + * Abstract implementation for a world. + * * @author Matthew Purland - * */ public class AbstractWorld implements World { // List of areas in the world private List<Area> areaList; - + // List of characters in the world private List<Character> characterList; - + /** - * {@inheritDoc} + * {@inheritDoc}s */ public List<Area> getAreas() { return areaList; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:29:35
|
Revision: 132 http://mud4j.svn.sourceforge.net/mud4j/?rev=132&view=rev Author: mpurland Date: 2007-06-02 18:29:23 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Refactor exception to RuntimeException and add serial id. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/ability/AbilityException.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/ability/AbilityException.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/ability/AbilityException.java 2007-06-03 01:27:15 UTC (rev 131) +++ trunk/mud4j-core/src/java/net/sf/mud4j/ability/AbilityException.java 2007-06-03 01:29:23 UTC (rev 132) @@ -17,19 +17,19 @@ package net.sf.mud4j.ability; /** - * An exception that occurs related to an exceptional condition with - * an ability. - * + * An exception that occurs related to an exceptional condition with an ability. + * * @author Matthew Purland */ -public class AbilityException extends Exception { - +public class AbilityException extends RuntimeException { + + private static final long serialVersionUID = -2414968678094658454L; + // Ability that the exceptio occurred upon. private Ability ability; - + /** - * Create an ability exception that can be tracked - * to a particular ability. + * Create an ability exception that can be tracked to a particular ability. * * @param ability Ability that throwed the exception. */ @@ -37,10 +37,10 @@ super(); this.ability = ability; } - + /** - * Creates an ability exception that can be tracked - * to a particular ability with a message. + * Creates an ability exception that can be tracked to a particular ability + * with a message. * * @param message Exception message for the exception. * @param ability Ability that throwed the exception. @@ -49,9 +49,10 @@ super(message); this.ability = ability; } - + /** * Return the ability. + * * @return Returns an ability for the exception. */ public Ability getAbility() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:27:34
|
Revision: 131 http://mud4j.svn.sourceforge.net/mud4j/?rev=131&view=rev Author: mpurland Date: 2007-06-02 18:27:15 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add comments in compareTo. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/WeaponItemType.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/item/WeaponItemType.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/WeaponItemType.java 2007-06-03 01:27:03 UTC (rev 130) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/item/WeaponItemType.java 2007-06-03 01:27:15 UTC (rev 131) @@ -72,12 +72,15 @@ if (o instanceof WeaponItemType) { WeaponItemType itemType = (WeaponItemType) o; + // If this weapon is greater than the one we are comparing to if (getWeaponAverageRating() > itemType.getWeaponAverageRating()) { return 1; } + // If this weapon is lesser than the one we are comparing to else if (getWeaponAverageRating() < itemType.getWeaponAverageRating()) { return -1; } + // If they are equal else { return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:27:34
|
Revision: 130 http://mud4j.svn.sourceforge.net/mud4j/?rev=130&view=rev Author: mpurland Date: 2007-06-02 18:27:03 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add comment for desire to refactor to composite. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/Item.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/item/Item.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/Item.java 2007-06-03 01:26:41 UTC (rev 129) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/item/Item.java 2007-06-03 01:27:03 UTC (rev 130) @@ -23,6 +23,7 @@ /** * Item interface for allowing different items to be created for a single API. * + * @todo Redo to follow Composite pattern * @author Matthew Purland */ public interface Item extends Effectable { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:26:54
|
Revision: 129 http://mud4j.svn.sourceforge.net/mud4j/?rev=129&view=rev Author: mpurland Date: 2007-06-02 18:26:41 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add comment to field. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItemType.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItemType.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItemType.java 2007-06-03 01:26:15 UTC (rev 128) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/item/AbstractItemType.java 2007-06-03 01:26:41 UTC (rev 129) @@ -25,6 +25,7 @@ */ public abstract class AbstractItemType implements ItemType { + // Name of the item type private String itemTypeName; /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:26:38
|
Revision: 128 http://mud4j.svn.sourceforge.net/mud4j/?rev=128&view=rev Author: mpurland Date: 2007-06-02 18:26:15 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc, and organize imports. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/area/AbstractArea.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/area/AbstractArea.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/area/AbstractArea.java 2007-06-03 01:25:14 UTC (rev 127) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/area/AbstractArea.java 2007-06-03 01:26:15 UTC (rev 128) @@ -16,7 +16,6 @@ package net.sf.mud4j.world.area; -import java.util.Collection; import java.util.List; import net.sf.mud4j.character.Character; @@ -33,6 +32,11 @@ // Name of the area private String areaName; + /** + * Constructs a new area with the specified area name. + * + * @param areaName Name of the area. + */ public AbstractArea(String areaName) { this.areaName = areaName; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:25:15
|
Revision: 127 http://mud4j.svn.sourceforge.net/mud4j/?rev=127&view=rev Author: mpurland Date: 2007-06-02 18:25:14 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/Room.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/Room.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/Room.java 2007-06-03 01:24:36 UTC (rev 126) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/Room.java 2007-06-03 01:25:14 UTC (rev 127) @@ -21,13 +21,11 @@ import net.sf.mud4j.effect.EffectBehavior; - /** - * Defines rooms interface as a location that events happen within. + * Defines rooms interface as a location that events happen within. TODO + * implement events for when a Placeable becomes moved TODO keep internal list + * of Placeables within room * - * TODO implement events for when a Placeable becomes moved - * TODO keep internal list of Placeables within room - * * @author Matthew Purland */ public class Room implements TileLocation { @@ -36,24 +34,31 @@ private List<Direction> directionList = new ArrayList<Direction>(); private EffectBehavior effectBehavior; private String roomName; - + + /** + * Constructor to create a default room. + */ public Room() { } - + /** * Get the name of the location. + * + * @return Returns the name of the room. */ - public String getName() { + public String getRoomName() { return roomName; } - + /** - * Set the name of the location; + * Set the name of the room. + * + * @param roomName Text of the room name */ - public void setName(String name) { - this.roomName = name; + public void setRoomName(String roomName) { + this.roomName = roomName; } - + /** * {@inheritDoc} */ @@ -66,8 +71,8 @@ */ public void removeDirection(Direction direction) { directionList.remove(direction); - } - + } + /** * {@inheritDoc} */ @@ -79,7 +84,6 @@ * {@inheritDoc} */ public void move(Placeable placeable) { - placeable.place(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:24:37
|
Revision: 126 http://mud4j.svn.sourceforge.net/mud4j/?rev=126&view=rev Author: mpurland Date: 2007-06-02 18:24:36 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add stat package. Added Paths: ----------- trunk/mud4j-core/src/java/net/sf/mud4j/stat/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:23:05
|
Revision: 125 http://mud4j.svn.sourceforge.net/mud4j/?rev=125&view=rev Author: mpurland Date: 2007-06-02 18:22:56 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add attribute interface. Added Paths: ----------- trunk/mud4j-core/src/java/net/sf/mud4j/attribute/ trunk/mud4j-core/src/java/net/sf/mud4j/attribute/Attribute.java Added: trunk/mud4j-core/src/java/net/sf/mud4j/attribute/Attribute.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/attribute/Attribute.java (rev 0) +++ trunk/mud4j-core/src/java/net/sf/mud4j/attribute/Attribute.java 2007-06-03 01:22:56 UTC (rev 125) @@ -0,0 +1,25 @@ +/** + * 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.attribute; + +/** + * + * + * @author Matthew Purland + */ +public interface Attribute { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:22:33
|
Revision: 124 http://mud4j.svn.sourceforge.net/mud4j/?rev=124&view=rev Author: mpurland Date: 2007-06-02 18:22:30 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add email address and changes to Account. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/account/Account.java Added Paths: ----------- trunk/mud4j-core/src/java/net/sf/mud4j/account/EmailAddress.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/account/Account.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/account/Account.java 2007-06-03 01:19:38 UTC (rev 123) +++ trunk/mud4j-core/src/java/net/sf/mud4j/account/Account.java 2007-06-03 01:22:30 UTC (rev 124) @@ -23,8 +23,13 @@ public class Account { // Username of the account private String username; + // Password of the account private String password; + + // Email address for the account + private EmailAddress emailAddress; + /** * Get the password. * @@ -57,4 +62,19 @@ public void setUsername(String username) { this.username = username; } + + /** + * Verify that the given password matches the account's password. + * + * @return true if the password matches. + */ + public boolean verifyPassword(String password) { + + // If the password matches + if (this.getPassword().equals(password)) { + return true; + } + + return false; + } } Added: trunk/mud4j-core/src/java/net/sf/mud4j/account/EmailAddress.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/account/EmailAddress.java (rev 0) +++ trunk/mud4j-core/src/java/net/sf/mud4j/account/EmailAddress.java 2007-06-03 01:22:30 UTC (rev 124) @@ -0,0 +1,36 @@ +/** + * 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.account; + +/** + * + * + * @todo Auto-generated doc stub for EmailAddress. + * + * @author Matthew Purland + */ +public class EmailAddress { + // Email address + private String emailAddress; + + public EmailAddress(String emailAddress) { + this.emailAddress = emailAddress; + } + + public String getEmailAddress() { + return emailAddress; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:19:40
|
Revision: 123 http://mud4j.svn.sourceforge.net/mud4j/?rev=123&view=rev Author: mpurland Date: 2007-06-02 18:19:38 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Add implementation for effect behavior to add and undo effects correctly. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/effect/DefaultEffectBehavior.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/effect/DefaultEffectBehavior.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/effect/DefaultEffectBehavior.java 2007-06-03 01:08:51 UTC (rev 122) +++ trunk/mud4j-core/src/java/net/sf/mud4j/effect/DefaultEffectBehavior.java 2007-06-03 01:19:38 UTC (rev 123) @@ -16,6 +16,7 @@ package net.sf.mud4j.effect; +import java.util.Iterator; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; @@ -26,7 +27,7 @@ */ public class DefaultEffectBehavior implements EffectBehavior { private List<Effect> effectsList = new CopyOnWriteArrayList<Effect>(); - + /** * {@inheritDoc} */ @@ -38,20 +39,33 @@ * {@inheritDoc} */ public void addEffect(Effect effect) { + // Notify the effect to apply itself + effect.apply(); + effectsList.add(effect); } /** * {@inheritDoc} */ - public void clear() { - effectsList.clear(); + public void removeEffect(Effect effect) { + // Notify the effect to remove itself + effect.undo(); + + effectsList.remove(effect); } /** * {@inheritDoc} */ - public void removeEffect(Effect effect) { - effectsList.remove(effect); + public void clear() { + // Notify each effect that they are being cleared + Iterator<Effect> effectsListIterator = effectsList.iterator(); + + while (effectsListIterator.hasNext()) { + Effect effect = effectsListIterator.next(); + + removeEffect(effect); + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:08:51
|
Revision: 122 http://mud4j.svn.sourceforge.net/mud4j/?rev=122&view=rev Author: mpurland Date: 2007-06-02 18:08:51 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc and add serial id. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/effect/NoSuchEffectException.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/effect/NoSuchEffectException.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/effect/NoSuchEffectException.java 2007-06-03 01:06:25 UTC (rev 121) +++ trunk/mud4j-core/src/java/net/sf/mud4j/effect/NoSuchEffectException.java 2007-06-03 01:08:51 UTC (rev 122) @@ -21,10 +21,27 @@ * @author Matthew Purland */ public class NoSuchEffectException extends EffectException { + + private static final long serialVersionUID = 625318920334455836L; + + /** + * Constructs a new exception that occurs when there is no such effect with + * a detailed message. + * + * @param mesg the detailed message + */ public NoSuchEffectException(String mesg) { super(mesg); } - public NoSuchEffectException(String mesg, Throwable obj) { - super(mesg, obj); + + /** + * Constructs a new exception that occurs when there is no such effect with + * a detailed message and cause. + * + * @param mesg the detailed message + * @param cause the cause of the original error + */ + public NoSuchEffectException(String mesg, Throwable cause) { + super(mesg, cause); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 01:06:26
|
Revision: 121 http://mud4j.svn.sourceforge.net/mud4j/?rev=121&view=rev Author: mpurland Date: 2007-06-02 18:06:25 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc and add serial id. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/effect/EffectException.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/effect/EffectException.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/effect/EffectException.java 2007-06-03 00:23:42 UTC (rev 120) +++ trunk/mud4j-core/src/java/net/sf/mud4j/effect/EffectException.java 2007-06-03 01:06:25 UTC (rev 121) @@ -16,18 +16,30 @@ package net.sf.mud4j.effect; /** - * Effect exception that occurs when an operation on an effect - * cannot occur. - * + * Effect exception that occurs when an operation on an effect cannot occur. + * * @author Matthew Purland */ -public class EffectException extends Exception { +public class EffectException extends RuntimeException { + private static final long serialVersionUID = 4356533482907810022L; + + /** + * Constructs a new effect exception with the detailed message. + * + * @param mesg the detailed message + */ public EffectException(String mesg) { super(mesg); } - - public EffectException(String mesg, Throwable obj) { - super(mesg, obj); + + /** + * Constructs a new effect exception with the detailed message and cause. + * + * @param mesg the detailed message + * @param cause the cause of the original error + */ + public EffectException(String mesg, Throwable cause) { + super(mesg, cause); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-06-03 00:23:43
|
Revision: 120 http://mud4j.svn.sourceforge.net/mud4j/?rev=120&view=rev Author: mpurland Date: 2007-06-02 17:23:42 -0700 (Sat, 02 Jun 2007) Log Message: ----------- Fix javadoc warnings by adding return type, formatting, and organizing imports. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/world/area/Area.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/world/area/Area.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/area/Area.java 2007-01-14 20:52:09 UTC (rev 119) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/area/Area.java 2007-06-03 00:23:42 UTC (rev 120) @@ -16,7 +16,6 @@ package net.sf.mud4j.world.area; -import java.util.Collection; import java.util.List; import net.sf.mud4j.character.Character; @@ -27,27 +26,34 @@ * Area interface for different types of areas. * * @author Matthew Purland - * */ public interface Area { - + /** * Get name of the area. + * + * @return Get name of the area. */ public String getAreaName(); - + /** * Retrieve list of rooms contained in the area. + * + * @return Returns a list of rooms in the area. */ public List<Room> getRooms(); - + /** * Retrieve list of players contained in the area. + * + * @return Returns a list of characters in the area. */ public List<Character> getCharacters(); - + /** * Retrieve list of items contained in area. + * + * @return Returns a list of items in the area. */ public List<Item> getItems(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-15 11:01:56
|
Revision: 96 http://mud4j.svn.sourceforge.net/mud4j/?rev=96&view=rev Author: mpurland Date: 2007-01-13 16:12:05 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Share project 'mud4j' into 'https://mud4j.svn.sourceforge.net/svnroot/mud4j/trunk/mud4j' Added Paths: ----------- trunk/mud4j/trunk/ trunk/mud4j/trunk/mud4j/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 21:06:04
|
Revision: 110 http://mud4j.svn.sourceforge.net/mud4j/?rev=110&view=rev Author: mpurland Date: 2007-01-13 19:18:47 -0800 (Sat, 13 Jan 2007) Log Message: ----------- Add resources directory and move persistence to resources dir. Added Paths: ----------- trunk/mud4j-core/resources/ trunk/mud4j-core/resources/persistence/ Removed Paths: ------------- trunk/mud4j-core/persistence/ Copied: trunk/mud4j-core/resources/persistence (from rev 106, trunk/mud4j-core/persistence) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 20:52:12
|
Revision: 119 http://mud4j.svn.sourceforge.net/mud4j/?rev=119&view=rev Author: mpurland Date: 2007-01-14 12:52:09 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Update for functional jetty server with dependencies in classpath. Modified Paths: -------------- trunk/mud4j-web/.classpath trunk/mud4j-web/pom.xml trunk/mud4j-web/src/java/net/sf/mud4j/web/Mud4jServer.java trunk/mud4j-web/src/java/net/sf/mud4j/web/server/JettyWebServer.java trunk/mud4j-web/src/test/functional/net/sf/mud4j/web/JettyWebServerTest.java Added Paths: ----------- trunk/mud4j-web/src/webapp/WEB-INF/faces-config.xml trunk/mud4j-web/src/webapp/WEB-INF/spring-config.xml trunk/mud4j-web/src/webapp/WEB-INF/web.xml trunk/mud4j-web/src/webapp/hello.jsp trunk/mud4j-web/src/webapp/index.jsp Removed Paths: ------------- trunk/mud4j-web/resources/faces-config.xml trunk/mud4j-web/resources/spring-config.xml trunk/mud4j-web/resources/web.xml Modified: trunk/mud4j-web/.classpath =================================================================== --- trunk/mud4j-web/.classpath 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/.classpath 2007-01-14 20:52:09 UTC (rev 119) @@ -1,8 +1,24 @@ <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src/java"/> + <classpathentry kind="src" path="src/test/unit"/> + <classpathentry kind="src" path="src/test/functional"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/mud4j-core"/> - <classpathentry kind="var" path="MAVEN_REPO/javax.servlet/jars/servlet-api-2.4.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/org.mortbay.jetty/jars/jetty-6.1.0rc3.jar" sourcepath="/OPT_JAVA/jetty-6.1.0rc3-src.zip"/> + <classpathentry kind="var" path="MAVEN_REPO/org.mortbay.jetty/jars/jetty-util-6.1.0rc3.jar"/> + <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.1.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/myfaces/core/myfaces-api/1.1.4/myfaces-api-1.1.4.jar"/> + <classpathentry kind="var" path="M2_REPO/org/apache/myfaces/core/myfaces-impl/1.1.4/myfaces-impl-1.1.4.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-digester/commons-digester/1.8/commons-digester-1.8.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.1/commons-collections-3.1.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-el/commons-el/1.0/commons-el-1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar"/> + <classpathentry kind="var" path="M2_REPO/javax/servlet/jstl/1.1.0/jstl-1.1.0.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jsp-api-2.1/6.1-SNAPSHOT/jsp-api-2.1-6.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/jsp-2.1/6.1-SNAPSHOT/jsp-2.1-6.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/org/mortbay/jetty/servlet-api-2.5/6.1-SNAPSHOT/servlet-api-2.5-6.1-SNAPSHOT.jar"/> + <classpathentry kind="var" path="M2_REPO/ant/ant/1.6.5/ant-1.6.5.jar"/> + <classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.1/commons-lang-2.1.jar"/> <classpathentry kind="output" path="bin"/> </classpath> Modified: trunk/mud4j-web/pom.xml =================================================================== --- trunk/mud4j-web/pom.xml 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/pom.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -76,7 +76,11 @@ <artifactId>myfaces-shared-tomahawk</artifactId> <version>2.0.3</version> </dependency> - + <dependency> + <groupId>commons-digester</groupId> + <artifactId>commons-digester</artifactId> + <version>1.8</version> + </dependency> </dependencies> <build> Deleted: trunk/mud4j-web/resources/faces-config.xml =================================================================== --- trunk/mud4j-web/resources/faces-config.xml 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/resources/faces-config.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -1,8 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!DOCTYPE faces-config PUBLIC - "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" - "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> -<!-- JSF Myfaces configuration --> -<faces-config> -</faces-config> \ No newline at end of file Deleted: trunk/mud4j-web/resources/spring-config.xml =================================================================== --- trunk/mud4j-web/resources/spring-config.xml 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/resources/spring-config.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -1,15 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- mud4j spring configuration --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xmlns:util="http://www.springframework.org/schema/util" - xmlns:aop="http://www.springframework.org/schema/aop" - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd - http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> - - <bean id="webServer" class="net.sf.mud4j.web.server.JettyWebServer"> - <constructor-arg type="int" value="8081" /> - </bean> -</beans> \ No newline at end of file Deleted: trunk/mud4j-web/resources/web.xml =================================================================== --- trunk/mud4j-web/resources/web.xml 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/resources/web.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" id="WebApp_ID"> - - <listener> - <listener-class> org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - <listener> - <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> - </listener> - - <description>web.xml</description> - <display-name>mud4j web application</display-name> - - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value>/WEB-INF/spring-config.xml</param-value> - </context-param> - -</web-app> \ No newline at end of file Modified: trunk/mud4j-web/src/java/net/sf/mud4j/web/Mud4jServer.java =================================================================== --- trunk/mud4j-web/src/java/net/sf/mud4j/web/Mud4jServer.java 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/src/java/net/sf/mud4j/web/Mud4jServer.java 2007-01-14 20:52:09 UTC (rev 119) @@ -33,15 +33,14 @@ public class Mud4jServer { public static void main(String[] args) { - AbstractApplicationContext appContext = new ClassPathXmlApplicationContext( - new String[] { "spring-config.xml" } ); - BeanFactory beanFactory = (BeanFactory) appContext; +// AbstractApplicationContext appContext = new ClassPathXmlApplicationContext( +// new String[] { "spring-config.xml" } ); +// BeanFactory beanFactory = (BeanFactory) appContext; +// +// appContext.registerShutdownHook(); - appContext.registerShutdownHook(); + WebServer webServer = new JettyWebServer("src/webapp", "/", 8081); - // Get our WebServer bean from our Spring beans - WebServer webServer = (WebServer) beanFactory.getBean("webServer", WebServer.class); - try { webServer.start(); } Modified: trunk/mud4j-web/src/java/net/sf/mud4j/web/server/JettyWebServer.java =================================================================== --- trunk/mud4j-web/src/java/net/sf/mud4j/web/server/JettyWebServer.java 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/src/java/net/sf/mud4j/web/server/JettyWebServer.java 2007-01-14 20:52:09 UTC (rev 119) @@ -23,10 +23,15 @@ import org.mortbay.jetty.Connector; import org.mortbay.jetty.Handler; +import org.mortbay.jetty.HandlerContainer; import org.mortbay.jetty.Request; import org.mortbay.jetty.Server; import org.mortbay.jetty.handler.AbstractHandler; +import org.mortbay.jetty.handler.ContextHandler; +import org.mortbay.jetty.handler.ContextHandlerCollection; import org.mortbay.jetty.nio.SelectChannelConnector; +import org.mortbay.jetty.servlet.Context; +import org.mortbay.jetty.webapp.WebAppContext; import org.mortbay.thread.BoundedThreadPool; /** @@ -42,13 +47,23 @@ // Port to listen on private int port; + + // Resource base path + private String resourceBasePath; + + // Context path + private String contextPath; /** * Constructor to provide configurable port listener. * + * @param resourceBasePath Path on the classpath for resources + * @param contextPath Http context path for serving resources * @param port Port to listen on. */ - public JettyWebServer(int port) { + public JettyWebServer(String resourceBasePath, String contextPath, int port) { + this.resourceBasePath = resourceBasePath; + this.contextPath = contextPath; this.port = port; } @@ -68,19 +83,35 @@ threadPool.setMaxThreads(100); server.setThreadPool(threadPool); - Handler handler = new AbstractHandler() - { - - public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException { - response.setContentType("text/html"); - response.setStatus(HttpServletResponse.SC_OK); - response.getWriter().println("<h1>testing</h1>"); - ((Request)request).setHandled(true); - - } - }; - server.setHandler(handler); +// Handler handler = new AbstractHandler() +// { +// +// public void handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch) throws IOException, ServletException { +// response.setContentType("text/html"); +// response.setStatus(HttpServletResponse.SC_OK); +// response.getWriter().println("<h1>testing</h1>"); +// ((Request)request).setHandled(true); +// +// } +// }; +// server.setHandler(handler); +// ContextHandler context = new ContextHandler(); +// context.setContextPath("/"); +// context.setResourceBase("."); +// context.setClassLoader(Thread.currentThread().getContextClassLoader()); +// server.setHandler(context); + +// ContextHandlerCollection contexts = new ContextHandlerCollection(); +// server.setHandler(contexts); + WebAppContext context = new WebAppContext(); + context.setResourceBase(resourceBasePath); + context.setContextPath(contextPath); + server.setHandler(context); + + +// WebAppContext.addWebApplications(server, "resources", "jetty-webdefault.xml", true, false); + server.setStopAtShutdown(true); server.setConnectors(new Connector[] { connector }); Modified: trunk/mud4j-web/src/test/functional/net/sf/mud4j/web/JettyWebServerTest.java =================================================================== --- trunk/mud4j-web/src/test/functional/net/sf/mud4j/web/JettyWebServerTest.java 2007-01-14 18:55:21 UTC (rev 118) +++ trunk/mud4j-web/src/test/functional/net/sf/mud4j/web/JettyWebServerTest.java 2007-01-14 20:52:09 UTC (rev 119) @@ -35,7 +35,7 @@ public void setUp() { - server = new JettyWebServer(JETTY_PORT); + server = new JettyWebServer("src/webapp", "/", JETTY_PORT); // Runnable serverRunnable = new WebServerThread(server) { // Copied: trunk/mud4j-web/src/webapp/WEB-INF/faces-config.xml (from rev 117, trunk/mud4j-web/resources/faces-config.xml) =================================================================== --- trunk/mud4j-web/src/webapp/WEB-INF/faces-config.xml (rev 0) +++ trunk/mud4j-web/src/webapp/WEB-INF/faces-config.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE faces-config PUBLIC + "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN" + "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"> +<!-- JSF Myfaces configuration --> +<faces-config> + <navigation-rule> + <from-view-id>/index.jsp</from-view-id> + <navigation-case> + <from-outcome>login</from-outcome> + <to-view-id>/hello.jsp</to-view-id> + </navigation-case> + + </navigation-rule> + +</faces-config> \ No newline at end of file Copied: trunk/mud4j-web/src/webapp/WEB-INF/spring-config.xml (from rev 117, trunk/mud4j-web/resources/spring-config.xml) =================================================================== --- trunk/mud4j-web/src/webapp/WEB-INF/spring-config.xml (rev 0) +++ trunk/mud4j-web/src/webapp/WEB-INF/spring-config.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- mud4j spring configuration --> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:util="http://www.springframework.org/schema/util" + xmlns:aop="http://www.springframework.org/schema/aop" + xsi:schemaLocation=" + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd + http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> +</beans> \ No newline at end of file Copied: trunk/mud4j-web/src/webapp/WEB-INF/web.xml (from rev 117, trunk/mud4j-web/resources/web.xml) =================================================================== --- trunk/mud4j-web/src/webapp/WEB-INF/web.xml (rev 0) +++ trunk/mud4j-web/src/webapp/WEB-INF/web.xml 2007-01-14 20:52:09 UTC (rev 119) @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<web-app xmlns="http://java.sun.com/xml/ns/j2ee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" + version="2.4" id="WebApp_ID"> + + <listener> + <listener-class> + org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> + <listener> + <listener-class> + org.springframework.web.context.request.RequestContextListener</listener-class> + </listener> + + <description>web.xml</description> + <display-name>mud4j web application</display-name> + + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value>/WEB-INF/spring-config.xml</param-value> + </context-param> + + <servlet> + <servlet-name>Faces Servlet</servlet-name> + <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + + <servlet-mapping> + <servlet-name>Faces Servlet</servlet-name> + <url-pattern>*.faces</url-pattern> + </servlet-mapping> + <servlet-mapping> + <servlet-name>Faces Servlet</servlet-name> + <url-pattern>*.jsf</url-pattern> + </servlet-mapping> +</web-app> \ No newline at end of file Added: trunk/mud4j-web/src/webapp/hello.jsp =================================================================== --- trunk/mud4j-web/src/webapp/hello.jsp (rev 0) +++ trunk/mud4j-web/src/webapp/hello.jsp 2007-01-14 20:52:09 UTC (rev 119) @@ -0,0 +1,16 @@ +<html> + <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> + <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> + + <f:view> + <head> + <title>A Simple JavaServer Faces Application (login)</title> + </head> + <body> + Hi there! + <h:form> + <h:commandButton value="Back" action="index"/> + </h:form> + </body> + </f:view> +</html> \ No newline at end of file Added: trunk/mud4j-web/src/webapp/index.jsp =================================================================== --- trunk/mud4j-web/src/webapp/index.jsp (rev 0) +++ trunk/mud4j-web/src/webapp/index.jsp 2007-01-14 20:52:09 UTC (rev 119) @@ -0,0 +1,32 @@ +<html> + <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %> + <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %> + + <f:view> + <head> + <title>A Simple JavaServer Faces Application (login)</title> + </head> + <body> + <h:form> + <h3>Please enter your name and password.</h3> + <table> + <tr> + <td>Name:</td> + <td> + + </td> + </tr> + <tr> + <td>Password:</td> + <td> + </td> + </tr> + </table> + <p> + <h:commandButton value="Login" action="login"/> + </p> + <b> + </h:form> + </body> + </f:view> +</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 18:55:24
|
Revision: 118 http://mud4j.svn.sourceforge.net/mud4j/?rev=118&view=rev Author: mpurland Date: 2007-01-14 10:55:21 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Add javadoc @param tag for hasAbility. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java 2007-01-14 18:51:03 UTC (rev 117) +++ trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java 2007-01-14 18:55:21 UTC (rev 118) @@ -51,6 +51,7 @@ /** * Determines if the character has an ability. + * @param ability The ability to check if the character has it. * @return Returns whether the character has an ability. */ public boolean hasAbility(CharacterAbility ability); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 18:51:07
|
Revision: 117 http://mud4j.svn.sourceforge.net/mud4j/?rev=117&view=rev Author: mpurland Date: 2007-01-14 10:51:03 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Add todo comment for pluggable attributes. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java 2007-01-14 18:48:46 UTC (rev 116) +++ trunk/mud4j-core/src/java/net/sf/mud4j/character/Character.java 2007-01-14 18:51:03 UTC (rev 117) @@ -26,6 +26,8 @@ /** * Interface for defining different types of players. * + * @todo Character attributes should be pluggable. We should not hard code attributes such as level and other things on a character. + * * @author Matthew Purland */ public interface Character extends Damageable, Messageable, Effectable { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 18:48:48
|
Revision: 116 http://mud4j.svn.sourceforge.net/mud4j/?rev=116&view=rev Author: mpurland Date: 2007-01-14 10:48:46 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Add race package for planned race packages. Added Paths: ----------- trunk/mud4j-core/src/java/net/sf/mud4j/race/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 18:48:08
|
Revision: 115 http://mud4j.svn.sourceforge.net/mud4j/?rev=115&view=rev Author: mpurland Date: 2007-01-14 10:48:06 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Add planned convert to convert areas from Rom24 area format. Added Paths: ----------- trunk/mud4j-core/src/java/net/sf/mud4j/world/area/convert/Rom24AreaConverter.java Added: trunk/mud4j-core/src/java/net/sf/mud4j/world/area/convert/Rom24AreaConverter.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/world/area/convert/Rom24AreaConverter.java (rev 0) +++ trunk/mud4j-core/src/java/net/sf/mud4j/world/area/convert/Rom24AreaConverter.java 2007-01-14 18:48:06 UTC (rev 115) @@ -0,0 +1,26 @@ +/** + * 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.area.convert; + +/** + * Area converter to convert areas from Rom24 area format to import directly + * into mud4j equivalent classes. + * + * @author Matthew Purland + */ +public class Rom24AreaConverter { + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mpu...@us...> - 2007-01-14 18:47:11
|
Revision: 114 http://mud4j.svn.sourceforge.net/mud4j/?rev=114&view=rev Author: mpurland Date: 2007-01-14 10:47:07 -0800 (Sun, 14 Jan 2007) Log Message: ----------- Remove CharacterEffect interface. Fix javadoc on classes. Add new mock test to provide new goal of testing of effect package. Modified Paths: -------------- trunk/mud4j-core/src/java/net/sf/mud4j/effect/AbstractCharacterEffect.java trunk/mud4j-core/src/java/net/sf/mud4j/effect/Effect.java trunk/mud4j-core/src/test/unit/net/mud4j/game/ability/MockCharacterAbility.java trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/CharacterEffectTest.java trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffect.java Added Paths: ----------- trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffectLevel.java Removed Paths: ------------- trunk/mud4j-core/src/java/net/sf/mud4j/effect/CharacterEffect.java Modified: trunk/mud4j-core/src/java/net/sf/mud4j/effect/AbstractCharacterEffect.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/effect/AbstractCharacterEffect.java 2007-01-14 18:45:05 UTC (rev 113) +++ trunk/mud4j-core/src/java/net/sf/mud4j/effect/AbstractCharacterEffect.java 2007-01-14 18:47:07 UTC (rev 114) @@ -19,39 +19,29 @@ import net.sf.mud4j.character.Character; /** + * Abstract character effect implementation for injecting a character on to + * an effect. + * * @author Matthew Purland * */ -public abstract class AbstractCharacterEffect extends AbstractEffect implements CharacterEffect { +public abstract class AbstractCharacterEffect extends AbstractEffect { private Character character; + /** + * Constructor to inject effect with a character. + * + * @param character + */ public AbstractCharacterEffect(Character character) { - setCharacter(character); + this.character = character; } - + /** - * {@inheritDoc} + * Get character for the effect. + * @return Returns the character for the effect. */ - public void setCharacter(Character character) { - this.character = character; - } -// -// /** -// * {@inheritDoc} -// */ -// @Override -// public void apply() { -// character.getEffectBehavior().addEffect(this); -// } -// -// /** -// * {@inheritDoc} -// */ -// @Override -// public void undo() { -// character.getEffectBehavior().removeEffect(this); -// } - - - + public Character getCharacter() { + return character; + } } Deleted: trunk/mud4j-core/src/java/net/sf/mud4j/effect/CharacterEffect.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/effect/CharacterEffect.java 2007-01-14 18:45:05 UTC (rev 113) +++ trunk/mud4j-core/src/java/net/sf/mud4j/effect/CharacterEffect.java 2007-01-14 18:47:07 UTC (rev 114) @@ -1,33 +0,0 @@ -/** - * 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.effect; - -import net.sf.mud4j.character.Character; - -/** - * Effect that adds effects to characters. - * - * @author Matthew Purland - */ -public interface CharacterEffect extends Effect { - - /** - * Set the character on the object. - * @param character Character to set. - */ - public void setCharacter(Character character); -} Modified: trunk/mud4j-core/src/java/net/sf/mud4j/effect/Effect.java =================================================================== --- trunk/mud4j-core/src/java/net/sf/mud4j/effect/Effect.java 2007-01-14 18:45:05 UTC (rev 113) +++ trunk/mud4j-core/src/java/net/sf/mud4j/effect/Effect.java 2007-01-14 18:47:07 UTC (rev 114) @@ -28,12 +28,14 @@ /** * Apply effect on the target. * @param target Target object to apply effect on. + * @throws EffectException in case of an apply failure. */ public void apply() throws EffectException; /** * Undo the effect from the target. * @param target Target object to remove effect from. + * @throws EffectException in case of an undo failure. */ public void undo() throws EffectException; @@ -46,11 +48,13 @@ /** * Determine if the effect is permanent. Permanent status means * that the effect cannot be removed. + * @return Retruns whether the effect is a permanent effect and cannot expire. */ public boolean isPermanent(); /** - * Get name of the effect + * Get name of the effect. + * @return Returns the name of the effect. */ public String getName(); } Modified: trunk/mud4j-core/src/test/unit/net/mud4j/game/ability/MockCharacterAbility.java =================================================================== --- trunk/mud4j-core/src/test/unit/net/mud4j/game/ability/MockCharacterAbility.java 2007-01-14 18:45:05 UTC (rev 113) +++ trunk/mud4j-core/src/test/unit/net/mud4j/game/ability/MockCharacterAbility.java 2007-01-14 18:47:07 UTC (rev 114) @@ -34,8 +34,10 @@ super(character); } - /* (non-Javadoc) - * @see net.sf.mud4j.ability.CharacterAbility#run(net.sf.mud4j.character.Character) + /** + * Test a character ability by testing through messaging the character. + * + * {@inheritDoc} */ public void run() throws AbilityException { try { Modified: trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/CharacterEffectTest.java =================================================================== --- trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/CharacterEffectTest.java 2007-01-14 18:45:05 UTC (rev 113) +++ trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/CharacterEffectTest.java 2007-01-14 18:47:07 UTC (rev 114) @@ -15,6 +15,8 @@ */ package net.mud4j.game.effect; +import java.util.Iterator; + import net.mud4j.test.MudTestCase; import net.sf.mud4j.character.Character; import net.sf.mud4j.effect.DefaultEffectBehavior; @@ -42,6 +44,9 @@ effect = new MockCharacterEffect(character); } + /** + * Test the effect name. + */ public void testCharacterEffect() { assertEquals(effect.getName(), "MockCharacterEffect"); } @@ -58,8 +63,13 @@ } + // Assert that the effect behavior contains the effect + assertTrue(character.getEffectBehavior().getEffects().contains(effect)); - assertTrue(character.getEffectBehavior().getEffects().contains(effect)); + effectBehavior.clear(); + + // Assert that the effect behavior now DOES NOT contain the effect + assertFalse(character.getEffectBehavior().getEffects().contains(effect)); } /** @@ -74,6 +84,26 @@ } + // Assert that the effect behavior DOES NOT contain the effect assertFalse(character.getEffectBehavior().getEffects().contains(effect)); } + + /** + * Test the effect of permanent/non-permanent effects. + */ + public void testCharacterEffectPermanent() { + try { + effect.apply(); + effectBehavior.addEffect(effect); + } + catch (EffectException ex) { + + } + + // Iterate through all effects and make sure all are not permanent. + for (Effect effect : effectBehavior.getEffects()) { + assertFalse(effect.isPermanent()); + } + + } } Modified: trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffect.java =================================================================== --- trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffect.java 2007-01-14 18:45:05 UTC (rev 113) +++ trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffect.java 2007-01-14 18:47:07 UTC (rev 114) @@ -25,10 +25,17 @@ */ public class MockCharacterEffect extends AbstractCharacterEffect { + /** + * Constructor to provide injection for character on to effect. + * @param character Character to set for the effect. + */ public MockCharacterEffect(Character character) { super(character); } + /** + * {@inheritDoc} + */ public String getName() { return "MockCharacterEffect"; } @@ -55,7 +62,7 @@ * {@inheritDoc} */ public boolean isPermanent() { - // TODO Auto-generated method stub + // Place this effect as non permanent. return false; } Added: trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffectLevel.java =================================================================== --- trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffectLevel.java (rev 0) +++ trunk/mud4j-core/src/test/unit/net/mud4j/game/effect/MockCharacterEffectLevel.java 2007-01-14 18:47:07 UTC (rev 114) @@ -0,0 +1,68 @@ +/** + * 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.mud4j.game.effect; + +import net.sf.mud4j.character.Character; +import net.sf.mud4j.effect.AbstractCharacterEffect; + +/** + * Mock character effect to test to increase level of character. + * + * @author Matthew Purland + */ +public class MockCharacterEffectLevel extends AbstractCharacterEffect { + + /** + * Constructor to provide injection for character on to effect. + * @param character Character to set for the effect. + */ + public MockCharacterEffectLevel(Character character) { + super(character); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return "MockCharacterEffectLevel"; + } + + /** + * {@inheritDoc} + */ + @Override + public void apply() { + + } + + /** + * {@inheritDoc} + */ + @Override + public void undo() { + // TODO Auto-generated method stub + + } + + /** + * {@inheritDoc} + */ + public boolean isPermanent() { + // Place this effect as non permanent. + return false; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |