From 4b9d52e7246d2c2919d6a24640796ab6a9b9afd9 Mon Sep 17 00:00:00 2001 From: Rogiel Date: Sat, 14 May 2011 13:27:28 -0300 Subject: [PATCH] Completed documentation Signed-off-by: Rogiel --- src/main/java/com/l2jserver/L2JConstants.java | 2 + .../l2jserver/{ => game}/ProtocolVersion.java | 2 +- .../game/net/Lineage2Connection.java | 4 +- .../packet/client/ProtocolVersionPacket.java | 2 +- .../server/CharacterSelectionListPacket.java | 2 +- .../model/id/factory/IDFactoryModule.java | 2 +- .../model/template/capability/Attackable.java | 9 ++ .../model/template/capability/Castable.java | 9 ++ .../model/template/capability/Consumable.java | 7 ++ .../model/template/capability/Defendable.java | 8 ++ .../template/capability/Enchantable.java | 8 ++ .../model/template/capability/Equipable.java | 8 ++ .../model/template/capability/Penalty.java | 2 +- .../capability/TemplateCapability.java | 9 +- .../l2jserver/model/world/AbstractActor.java | 24 +++- .../l2jserver/model/world/AbstractObject.java | 3 + .../java/com/l2jserver/model/world/Clan.java | 8 +- .../java/com/l2jserver/model/world/Item.java | 20 ++++ .../java/com/l2jserver/model/world/Party.java | 9 +- .../java/com/l2jserver/model/world/Pet.java | 39 ++++++- .../l2jserver/model/world/WorldObject.java | 7 ++ .../model/world/actor/ActorEffects.java | 14 +++ .../model/world/actor/ActorEvent.java | 5 + .../model/world/actor/ActorExperience.java | 14 +++ .../model/world/actor/ActorListener.java | 6 + .../world/character/CharacterAttributes.java | 10 ++ .../CharacterCalculatedAttributes.java | 14 +++ .../model/world/character/CharacterClass.java | 107 ++++++++++++++++++ .../world/character/CharacterFriendList.java | 22 +++- .../world/character/CharacterInventory.java | 37 +++++- .../l2jserver/model/world/clan/ClanEvent.java | 8 ++ .../model/world/clan/ClanListener.java | 5 + .../model/world/clan/ClanMembers.java | 6 + .../model/world/event/SpawnEvent.java | 6 + .../model/world/event/WorldEvent.java | 6 + .../model/world/filter/AndFilter.java | 18 +++ .../model/world/filter/NotFilter.java | 18 +++ .../model/world/filter/OrFilter.java | 18 +++ .../model/world/filter/WorldFilters.java | 34 +++++- .../model/world/filter/impl/IDFilter.java | 14 +++ .../world/filter/impl/InstanceFilter.java | 16 +++ .../model/world/filter/impl/RangeFilter.java | 27 +++++ .../model/world/item/ItemDropEvent.java | 19 ++++ .../l2jserver/model/world/item/ItemEvent.java | 9 ++ .../model/world/item/ItemListener.java | 5 + .../model/world/iterator/FilterIterator.java | 35 +++++- .../model/world/party/PartyEvent.java | 6 + .../model/world/party/PartyListener.java | 5 + .../model/world/player/PlayerEvent.java | 8 ++ .../model/world/player/PlayerListener.java | 5 + .../model/world/player/PlayerSpawnEvent.java | 19 ++++ .../world/player/PlayerTeleportEvent.java | 13 +++ .../model/world/player/TestEvent.java | 6 - .../GameServerInitializationRoutine.java | 14 +++ .../java/com/l2jserver/routines/Routine.java | 8 ++ .../model/id/factory/IDFactoryTest.java | 1 + 56 files changed, 716 insertions(+), 26 deletions(-) rename src/main/java/com/l2jserver/{ => game}/ProtocolVersion.java (96%) delete mode 100644 src/main/java/com/l2jserver/model/world/player/TestEvent.java diff --git a/src/main/java/com/l2jserver/L2JConstants.java b/src/main/java/com/l2jserver/L2JConstants.java index f064e6e45..df8b526d9 100644 --- a/src/main/java/com/l2jserver/L2JConstants.java +++ b/src/main/java/com/l2jserver/L2JConstants.java @@ -1,5 +1,7 @@ package com.l2jserver; +import com.l2jserver.game.ProtocolVersion; + /** * Constant values for this L2J compilation * diff --git a/src/main/java/com/l2jserver/ProtocolVersion.java b/src/main/java/com/l2jserver/game/ProtocolVersion.java similarity index 96% rename from src/main/java/com/l2jserver/ProtocolVersion.java rename to src/main/java/com/l2jserver/game/ProtocolVersion.java index 99733ece9..533bcabef 100644 --- a/src/main/java/com/l2jserver/ProtocolVersion.java +++ b/src/main/java/com/l2jserver/game/ProtocolVersion.java @@ -1,4 +1,4 @@ -package com.l2jserver; +package com.l2jserver.game; /** * Represents the protocol version used by the client diff --git a/src/main/java/com/l2jserver/game/net/Lineage2Connection.java b/src/main/java/com/l2jserver/game/net/Lineage2Connection.java index 722c437e2..e37a3dc35 100644 --- a/src/main/java/com/l2jserver/game/net/Lineage2Connection.java +++ b/src/main/java/com/l2jserver/game/net/Lineage2Connection.java @@ -3,7 +3,7 @@ package com.l2jserver.game.net; import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelFuture; -import com.l2jserver.ProtocolVersion; +import com.l2jserver.game.ProtocolVersion; import com.l2jserver.game.net.codec.Lineage2Decrypter; import com.l2jserver.game.net.codec.Lineage2Encrypter; import com.l2jserver.game.net.codec.Lineage2PacketReader; @@ -135,7 +135,7 @@ public class Lineage2Connection { * * @param version * @return true if version is supported by the client - * @see com.l2jserver.ProtocolVersion#supports(com.l2jserver.ProtocolVersion) + * @see com.l2jserver.game.ProtocolVersion#supports(com.l2jserver.game.ProtocolVersion) */ public boolean supports(ProtocolVersion version) { if (version == null) diff --git a/src/main/java/com/l2jserver/game/net/packet/client/ProtocolVersionPacket.java b/src/main/java/com/l2jserver/game/net/packet/client/ProtocolVersionPacket.java index 3c707718c..bed448ee8 100644 --- a/src/main/java/com/l2jserver/game/net/packet/client/ProtocolVersionPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/client/ProtocolVersionPacket.java @@ -7,7 +7,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.l2jserver.L2JConstants; -import com.l2jserver.ProtocolVersion; +import com.l2jserver.game.ProtocolVersion; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2CryptographyKey; import com.l2jserver.game.net.packet.AbstractClientPacket; diff --git a/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java b/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java index 73811336c..b510b3f01 100644 --- a/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java +++ b/src/main/java/com/l2jserver/game/net/packet/server/CharacterSelectionListPacket.java @@ -2,7 +2,7 @@ package com.l2jserver.game.net.packet.server; import org.jboss.netty.buffer.ChannelBuffer; -import com.l2jserver.ProtocolVersion; +import com.l2jserver.game.ProtocolVersion; import com.l2jserver.game.net.Lineage2Connection; import com.l2jserver.game.net.Lineage2Session; import com.l2jserver.game.net.packet.AbstractServerPacket; diff --git a/src/main/java/com/l2jserver/model/id/factory/IDFactoryModule.java b/src/main/java/com/l2jserver/model/id/factory/IDFactoryModule.java index 76445ccf4..4010901ef 100644 --- a/src/main/java/com/l2jserver/model/id/factory/IDFactoryModule.java +++ b/src/main/java/com/l2jserver/model/id/factory/IDFactoryModule.java @@ -7,8 +7,8 @@ import com.google.inject.assistedinject.FactoryModuleBuilder; import com.l2jserver.model.id.object.allocator.BitSetIDAllocator; import com.l2jserver.model.id.object.allocator.IDAllocator; import com.l2jserver.model.id.object.factory.CharacterIDFactory; -import com.l2jserver.model.id.object.factory.CharacterIDFactory.CharacterIDGuiceFactory; import com.l2jserver.model.id.object.factory.ItemIDFactory; +import com.l2jserver.model.id.object.factory.CharacterIDFactory.CharacterIDGuiceFactory; import com.l2jserver.model.id.object.factory.ItemIDFactory.ItemIDGuiceFactory; import com.l2jserver.model.id.template.factory.CharacterTemplateIDFactory; import com.l2jserver.model.id.template.factory.ItemTemplateIDFactory; diff --git a/src/main/java/com/l2jserver/model/template/capability/Attackable.java b/src/main/java/com/l2jserver/model/template/capability/Attackable.java index 341a3d80e..0799f2448 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Attackable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Attackable.java @@ -1,7 +1,16 @@ package com.l2jserver.model.template.capability; +import com.l2jserver.model.template.Template; import com.l2jserver.model.world.capability.Attacker; +/** + * Defines an {@link Template template} {@link TemplateCapability capability} + * that an {@link Attacker} can use to attack an + * {@link com.l2jserver.model.world.capability.Attackable} + * + * @author Rogiel + * + */ public interface Attackable extends TemplateCapability { void attack(Attacker source, com.l2jserver.model.world.capability.Attackable target); diff --git a/src/main/java/com/l2jserver/model/template/capability/Castable.java b/src/main/java/com/l2jserver/model/template/capability/Castable.java index 5d1990710..d6ea75656 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Castable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Castable.java @@ -1,7 +1,16 @@ package com.l2jserver.model.template.capability; +import com.l2jserver.model.template.Template; import com.l2jserver.model.world.capability.Caster; +/** + * Defines an {@link Template template} {@link TemplateCapability capability} + * that an {@link Caster} can cast on an + * {@link com.l2jserver.model.world.capability.Castable}. + * + * @author Rogiel + * + */ public interface Castable extends TemplateCapability { void cast(Caster caster, com.l2jserver.model.world.capability.Castable... targets); diff --git a/src/main/java/com/l2jserver/model/template/capability/Consumable.java b/src/main/java/com/l2jserver/model/template/capability/Consumable.java index 6baab8210..db3a1b32b 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Consumable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Consumable.java @@ -1,7 +1,14 @@ package com.l2jserver.model.template.capability; +import com.l2jserver.model.template.Template; import com.l2jserver.model.world.capability.Attacker; +/** + * Defines an {@link Template template} {@link TemplateCapability capability} + * that can be consumed. + * + * @author Rogiel + */ public interface Consumable extends TemplateCapability { void consume(Attacker source, com.l2jserver.model.world.capability.Attackable target); diff --git a/src/main/java/com/l2jserver/model/template/capability/Defendable.java b/src/main/java/com/l2jserver/model/template/capability/Defendable.java index 61271f844..7d12b50b3 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Defendable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Defendable.java @@ -1,7 +1,15 @@ package com.l2jserver.model.template.capability; +import com.l2jserver.model.template.Template; import com.l2jserver.model.world.capability.Attacker; +/** + * Defines an {@link Template template} {@link TemplateCapability capability} + * that an {@link com.l2jserver.model.world.capability.Attackable} can use to + * defend from an {@link Attacker}. + * + * @author Rogiel + */ public interface Defendable extends TemplateCapability { void defend(Attacker source, com.l2jserver.model.world.capability.Attackable target); diff --git a/src/main/java/com/l2jserver/model/template/capability/Enchantable.java b/src/main/java/com/l2jserver/model/template/capability/Enchantable.java index be1c99781..10ec33c84 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Enchantable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Enchantable.java @@ -1,5 +1,13 @@ package com.l2jserver.model.template.capability; +import com.l2jserver.model.template.Template; + +/** + * Defines an {@link Template template} {@link TemplateCapability capability} + * for an object that can be enchanted. + * + * @author Rogiel + */ public interface Enchantable extends TemplateCapability { void enchant(com.l2jserver.model.world.capability.Enchantable target); } diff --git a/src/main/java/com/l2jserver/model/template/capability/Equipable.java b/src/main/java/com/l2jserver/model/template/capability/Equipable.java index 5285044a2..d71e1c342 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Equipable.java +++ b/src/main/java/com/l2jserver/model/template/capability/Equipable.java @@ -1,7 +1,15 @@ package com.l2jserver.model.template.capability; +import com.l2jserver.model.template.Template; import com.l2jserver.model.world.capability.Equiper; +/** + * Defines an {@link Template template} {@link TemplateCapability capability} + * for an object that acn be equipable by an {@link Equiper}. + * + * @author Rogiel + * + */ public interface Equipable extends TemplateCapability { void equip(Equiper equiper); } diff --git a/src/main/java/com/l2jserver/model/template/capability/Penalty.java b/src/main/java/com/l2jserver/model/template/capability/Penalty.java index 069abeb2f..f29e9c720 100644 --- a/src/main/java/com/l2jserver/model/template/capability/Penalty.java +++ b/src/main/java/com/l2jserver/model/template/capability/Penalty.java @@ -5,7 +5,7 @@ import com.l2jserver.model.world.capability.Equiper; /** * Indicated than an {@link AbstractTemplate} can add penalties to an given - * user. + * {@link Equiper}. * * @author Rogiel */ diff --git a/src/main/java/com/l2jserver/model/template/capability/TemplateCapability.java b/src/main/java/com/l2jserver/model/template/capability/TemplateCapability.java index ef01ac556..4e318db5e 100644 --- a/src/main/java/com/l2jserver/model/template/capability/TemplateCapability.java +++ b/src/main/java/com/l2jserver/model/template/capability/TemplateCapability.java @@ -1,5 +1,12 @@ package com.l2jserver.model.template.capability; -public interface TemplateCapability { +import com.l2jserver.model.template.Template; +/** + * Defines an {@link Template template} {@link TemplateCapability capability}. + * Each capability is something that the template "knows" and "can" do. + * + * @author Rogiel + */ +public interface TemplateCapability { } diff --git a/src/main/java/com/l2jserver/model/world/AbstractActor.java b/src/main/java/com/l2jserver/model/world/AbstractActor.java index 4876d2a5e..4f41999bb 100644 --- a/src/main/java/com/l2jserver/model/world/AbstractActor.java +++ b/src/main/java/com/l2jserver/model/world/AbstractActor.java @@ -10,7 +10,15 @@ import com.l2jserver.model.world.capability.Equipable; import com.l2jserver.model.world.capability.Equiper; import com.l2jserver.util.Coordinate; +/** + * Abstract {@link Actor} class. + * + * @author Rogiel + */ public abstract class AbstractActor extends AbstractObject implements Actor { + /** + * The actor race + */ protected Race race; /** @@ -37,6 +45,9 @@ public abstract class AbstractActor extends AbstractObject implements Actor { } } + /** + * The actor sex + */ protected Sex sex; /** @@ -63,10 +74,21 @@ public abstract class AbstractActor extends AbstractObject implements Actor { } } + /** + * The actor level + */ protected int level; + /** + * The actor HP + */ protected int hp; + /** + * The actor coordinate + */ protected Coordinate position; - + /** + * The currently effects active on the actor + */ protected final ActorEffects effects = new ActorEffects(this); @Override diff --git a/src/main/java/com/l2jserver/model/world/AbstractObject.java b/src/main/java/com/l2jserver/model/world/AbstractObject.java index b8f451448..8df97d480 100644 --- a/src/main/java/com/l2jserver/model/world/AbstractObject.java +++ b/src/main/java/com/l2jserver/model/world/AbstractObject.java @@ -8,6 +8,9 @@ import com.l2jserver.model.id.ObjectID; * @author Rogiel */ public abstract class AbstractObject implements WorldObject { + /** + * The {@link ObjectID} + */ protected ObjectID id; public ObjectID getID() { diff --git a/src/main/java/com/l2jserver/model/world/Clan.java b/src/main/java/com/l2jserver/model/world/Clan.java index 533d3dbf0..d517738ca 100644 --- a/src/main/java/com/l2jserver/model/world/Clan.java +++ b/src/main/java/com/l2jserver/model/world/Clan.java @@ -11,6 +11,11 @@ import com.l2jserver.model.world.clan.ClanEvent; import com.l2jserver.model.world.clan.ClanListener; import com.l2jserver.model.world.clan.ClanMembers; +/** + * This class represents an clan in the Lineage II world + * + * @author Rogiel + */ public class Clan extends AbstractObject implements Listenable, Joinable { /** @@ -23,9 +28,6 @@ public class Clan extends AbstractObject implements */ private final ClanMembers members = new ClanMembers(this); - /** - * Remember to save your clan! - */ @Override public void join(L2Character member) { members.add(member); diff --git a/src/main/java/com/l2jserver/model/world/Item.java b/src/main/java/com/l2jserver/model/world/Item.java index 8c04a58ac..da1d71211 100644 --- a/src/main/java/com/l2jserver/model/world/Item.java +++ b/src/main/java/com/l2jserver/model/world/Item.java @@ -12,6 +12,26 @@ import com.l2jserver.model.world.item.ItemEvent; import com.l2jserver.model.world.item.ItemListener; import com.l2jserver.util.Coordinate; +/** + * This class represents an {@link Item} in the Lineage II World. The item can + * be: + *
    + *
  • In the {@link L2Character character} inventory: location + * is {@link InventoryLocation#INVENTORY}, coordinate and + * paperdoll are null.
  • + *
  • In the {@link L2Character character} warehouse: location + * is {@link InventoryLocation#WAREHOUSE}, coordinate and + * paperdoll are null.
  • + *
  • Equipped by the {@link L2Character character}: location + * is {@link InventoryLocation#PAPERDOLL}, paperdoll is not null and + * coordinate is null.
  • + *
  • Dropped on the ground: location
  • and paperdoll + * are null, coordinate is not null and represents the dropping + * location. + *
+ * + * @author Rogiel + */ public class Item extends AbstractObject implements Playable, Spawnable, Listenable, Dropable { private final ItemTemplateID templateID; diff --git a/src/main/java/com/l2jserver/model/world/Party.java b/src/main/java/com/l2jserver/model/world/Party.java index 0778ee662..eb82b30a2 100644 --- a/src/main/java/com/l2jserver/model/world/Party.java +++ b/src/main/java/com/l2jserver/model/world/Party.java @@ -12,8 +12,16 @@ import com.l2jserver.model.world.party.PartyEvent; import com.l2jserver.model.world.party.PartyListener; import com.l2jserver.util.factory.CollectionFactory; +/** + * This class represents an Party in Lineage II world + * + * @author Rogiel + */ public class Party extends AbstractObject implements Listenable, Joinable { + /** + * Active party members + */ private final List members = CollectionFactory .newList(CharacterID.class); @@ -29,7 +37,6 @@ public class Party extends AbstractObject implements @Override public void leave(L2Character member) { - // TODO Auto-generated method stub } diff --git a/src/main/java/com/l2jserver/model/world/Pet.java b/src/main/java/com/l2jserver/model/world/Pet.java index 0c975be39..67dda6b2d 100644 --- a/src/main/java/com/l2jserver/model/world/Pet.java +++ b/src/main/java/com/l2jserver/model/world/Pet.java @@ -1,11 +1,24 @@ package com.l2jserver.model.world; import com.l2jserver.model.id.object.CharacterID; +import com.l2jserver.model.id.object.ItemID; import com.l2jserver.model.world.capability.Summonable; import com.l2jserver.util.Coordinate; +/** + * This class represents an Pet in the Lineage II World + * + * @author Rogiel + */ public class Pet extends Player implements Summonable { + /** + * The {@link CharacterID} pet's owner + */ private CharacterID ownerID; + /** + * {@link ItemID} used to summon this pet + */ + private ItemID itemID; @Override public void teleport(Coordinate coordinate) { @@ -26,7 +39,7 @@ public class Pet extends Player implements Summonable { } /** - * @return the ownerID + * @return the owner ID */ public CharacterID getOwnerID() { return ownerID; @@ -41,9 +54,31 @@ public class Pet extends Player implements Summonable { /** * @param ownerID - * the ownerID to set + * the owner ID to set */ public void setOwnerID(CharacterID ownerID) { this.ownerID = ownerID; } + + /** + * @return the item ID + */ + public ItemID getItemID() { + return itemID; + } + + /** + * @return the item + */ + public Item getItem() { + return itemID.getObject(); + } + + /** + * @param itemID + * the item ID to set + */ + public void setItemID(ItemID itemID) { + this.itemID = itemID; + } } diff --git a/src/main/java/com/l2jserver/model/world/WorldObject.java b/src/main/java/com/l2jserver/model/world/WorldObject.java index e541097b5..74f6ef99e 100644 --- a/src/main/java/com/l2jserver/model/world/WorldObject.java +++ b/src/main/java/com/l2jserver/model/world/WorldObject.java @@ -2,6 +2,13 @@ package com.l2jserver.model.world; import com.l2jserver.model.id.ObjectID; +/** + * This is an base interface that every object in the Lineage II World need to + * implement. The only methods defines by this class are getters and setters for + * {@link ObjectID}. + * + * @author Rogiel + */ public interface WorldObject { /** * Get the object's ID diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java b/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java index 9fe5d534d..a524c8f66 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorEffects.java @@ -2,9 +2,23 @@ package com.l2jserver.model.world.actor; import com.l2jserver.model.world.capability.Actor; +/** + * Class controlling active effects on an {@link Actor}. + * + * @author Rogiel + */ public class ActorEffects { + /** + * The actor being affected by the effects + */ private final Actor actor; + /** + * Creates a new instance + * + * @param actor + * the actor + */ public ActorEffects(Actor actor) { this.actor = actor; } diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorEvent.java b/src/main/java/com/l2jserver/model/world/actor/ActorEvent.java index 0945e0239..003e98055 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorEvent.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorEvent.java @@ -3,6 +3,11 @@ package com.l2jserver.model.world.actor; import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.event.WorldEvent; +/** + * Base event for {@link Actor} instances + * + * @author Rogiel + */ public interface ActorEvent extends WorldEvent { Actor getActor(); } diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java b/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java index 78ed6c5f0..a91e5a1c4 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorExperience.java @@ -1,5 +1,12 @@ package com.l2jserver.model.world.actor; +import com.l2jserver.model.world.capability.Actor; + +/** + * This enumeration maps for each level the minimum experience required. + * + * @author Rogiel + */ public enum ActorExperience { /** * This is an unreachable level! @@ -60,6 +67,13 @@ public enum ActorExperience { this.level = this.ordinal(); } + /** + * Look for level of the {@link Actor} given it's experience + * + * @param experience + * the experience value + * @return the {@link ActorExperience} + */ public static ActorExperience getLevel(long experience) { ActorExperience last = ActorExperience.LEVEL_0; for (ActorExperience exp : values()) { diff --git a/src/main/java/com/l2jserver/model/world/actor/ActorListener.java b/src/main/java/com/l2jserver/model/world/actor/ActorListener.java index fc4836b16..3c8c0f8c3 100644 --- a/src/main/java/com/l2jserver/model/world/actor/ActorListener.java +++ b/src/main/java/com/l2jserver/model/world/actor/ActorListener.java @@ -1,6 +1,12 @@ package com.l2jserver.model.world.actor; +import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.event.WorldListener; +/** + * Base listener for {@link Actor} instances + * + * @author Rogiel + */ public interface ActorListener extends WorldListener { } diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterAttributes.java b/src/main/java/com/l2jserver/model/world/character/CharacterAttributes.java index 1508f692d..68b409ede 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterAttributes.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterAttributes.java @@ -1,5 +1,15 @@ package com.l2jserver.model.world.character; +import com.l2jserver.model.template.CharacterTemplate; + +/** + * Defines attributes of the character. Implementations can use an static value + * (i.e. from {@link CharacterTemplate}) or can use an calculator to define + * values, composed from many attributes objects. + * + * @author Rogiel + * + */ public interface CharacterAttributes { /** * @return the intelligence diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterCalculatedAttributes.java b/src/main/java/com/l2jserver/model/world/character/CharacterCalculatedAttributes.java index 451ad1fe3..9c4898bb7 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterCalculatedAttributes.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterCalculatedAttributes.java @@ -1,9 +1,23 @@ package com.l2jserver.model.world.character; +import com.l2jserver.model.template.CharacterTemplate; import com.l2jserver.model.world.L2Character; +/** + * This {@link CharacterAttributes} implementation calculates the real + * character attributes based on it's {@link CharacterTemplate} and active + * buffs. + * + * @author Rogiel + */ public class CharacterCalculatedAttributes implements CharacterAttributes { + /** + * The character + */ private final L2Character character; + /** + * The base attributes (from {@link CharacterTemplate}) + */ private final CharacterAttributes baseAttributes; public CharacterCalculatedAttributes(L2Character character) { diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterClass.java b/src/main/java/com/l2jserver/model/world/character/CharacterClass.java index 29d958d4e..dda5b0f21 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterClass.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterClass.java @@ -143,12 +143,41 @@ public enum CharacterClass { null, null), DUMMY_ENTRY_33(0x79, null, false, null, null), DUMMY_ENTRY_34( 0x7a, null, false, null, null); + /** + * The Class ID + */ public final int id; + /** + * The class type + */ public final ClassType type; + /** + * Is this class summoner? + */ public final boolean summoner; + /** + * The class race + */ public final Race race; + /** + * The parent class + */ public final CharacterClass parent; + /** + * Creates a new class + * + * @param id + * the id + * @param type + * the type + * @param summoner + * is summoner + * @param race + * the race + * @param parent + * the parent + */ private CharacterClass(int id, ClassType type, boolean summoner, Race race, CharacterClass parent) { this.id = id; @@ -158,31 +187,104 @@ public enum CharacterClass { this.parent = parent; } + /** + * Creates a new instance, will inherit type, summoner and + * race from parent + * + * @param id + * the id + * @param parent + * the parent + */ private CharacterClass(int id, CharacterClass parent) { this(id, parent.type, parent.summoner, parent.race, parent); } + /** + * Creates a new instance, will inherit type and race from + * parent + * + * @param id + * the class id + * @param summoner + * is summoner + * @param parent + * the parent + */ private CharacterClass(int id, boolean summoner, CharacterClass parent) { this(id, parent.type, summoner, parent.race, parent); } + /** + * Creates a new instance, will inherit type and summoner + * from parent + * + * @param id + * the class id + * @param race + * the race + * @param parent + * the parent class + */ private CharacterClass(int id, Race race, CharacterClass parent) { this(id, parent.type, parent.summoner, race, parent); } + /** + * Creates a new instance, will inherit summoner will be false and + * parent null. + * + * @param id + * the id + * @param type + * the class type + * @param race + * the class race + */ private CharacterClass(int id, ClassType type, Race race) { this(id, type, false, race, null); } + /** + * Creates a new instance will inherit race from parent. + * summoner will be false + * + * @param id + * the class id + * @param type + * the class type + * @param parent + * the parent class + */ private CharacterClass(int id, ClassType type, CharacterClass parent) { this(id, type, false, parent.race, parent); } + /** + * Creates a new instance will inherit race from parent + * + * @param id + * the class id + * @param type + * the class type + * @param summoner + * is class summoner + * @param parent + * the parent class + */ private CharacterClass(int id, ClassType type, boolean summoner, CharacterClass parent) { this(id, type, summoner, parent.race, parent); } + /** + * Tries to locate the class based on its ID. If not found, null is + * returned. + * + * @param id + * the class id + * @return the {@link CharacterClass} instance found + */ public CharacterClass fromID(int id) { for (final CharacterClass c : values()) { if (c.id == id) @@ -202,6 +304,11 @@ public enum CharacterClass { return 1 + parent.level(); } + /** + * The class type + * + * @author Rogiel + */ public enum ClassType { FIGHTER, MYSTIC, PRIEST; } diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterFriendList.java b/src/main/java/com/l2jserver/model/world/character/CharacterFriendList.java index f8180c18e..a964ae689 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterFriendList.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterFriendList.java @@ -10,16 +10,28 @@ import com.l2jserver.model.world.L2Character; import com.l2jserver.util.factory.CollectionFactory; /** - * Defines how an character looks in-game. + * Controls the friend list of an {@link L2Character} * * @author Rogiel */ public class CharacterFriendList implements Iterable { + /** + * The character + */ private final L2Character character; + /** + * The list of friends of this character + */ private final Set friends = CollectionFactory .newSet(CharacterID.class); + /** + * Creates a new instance + * + * @param character + * the parent character + */ public CharacterFriendList(L2Character character) { this.character = character; } @@ -45,6 +57,14 @@ public class CharacterFriendList implements Iterable { return new WorldObjectIterator(friends.iterator()); } + /** + * Load an {@link Collection} of {@link CharacterID} to this object. + *

+ * Note that this is normally used by DAOs do load data. + * + * @param list + * the id list + */ public void load(Collection list) { friends.addAll(list); } diff --git a/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java b/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java index 31f3d87ef..621981999 100644 --- a/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java +++ b/src/main/java/com/l2jserver/model/world/character/CharacterInventory.java @@ -8,7 +8,15 @@ import com.l2jserver.model.world.Item; import com.l2jserver.model.world.L2Character; import com.l2jserver.util.factory.CollectionFactory; +/** + * This class controls an {@link L2Character} inventory + * + * @author Rogiel + */ public class CharacterInventory implements Iterable { + /** + * The character + */ private final L2Character character; /** @@ -16,6 +24,12 @@ public class CharacterInventory implements Iterable { */ private final Set items = CollectionFactory.newSet(Item.class); + /** + * Creates a new instance + * + * @param character + * the character + */ public CharacterInventory(L2Character character) { this.character = character; } @@ -43,10 +57,31 @@ public class CharacterInventory implements Iterable { return items.iterator(); } + /** + * Location of an item + * + * @author Rogiel + */ public enum InventoryLocation { - PAPERDOLL, INVENTORY; + /** + * The item is equipped + */ + PAPERDOLL, + /** + * The item is stored in the inventory + */ + INVENTORY, + /** + * The item is in the warehouse + */ + WAREHOUSE; } + /** + * {@link InventoryLocation#PAPERDOLL Paperdoll} slots for items + * + * @author Rogiel + */ public enum InventoryPaperdoll { UNDERWEAR, HEAD, HAIR1, HAIR2, NECK, RIGHT_HAND, LEFT_HAND, RIGHT_EAR, LEFT_EAR, GLOVES, LEGS, LEFT_FEET, RIGHT_FEET, RIGHT_FINGER, LEFT_FINGER, LEFT_BRACELET, RIGHT_BRACELET, DECORATION_1, DECOREATION_2, DECORATION_3, DECORATION_4, DECORATION_5, DECORATION_6, CLOAK, BELT; } diff --git a/src/main/java/com/l2jserver/model/world/clan/ClanEvent.java b/src/main/java/com/l2jserver/model/world/clan/ClanEvent.java index 021326a1b..a3555f031 100644 --- a/src/main/java/com/l2jserver/model/world/clan/ClanEvent.java +++ b/src/main/java/com/l2jserver/model/world/clan/ClanEvent.java @@ -3,6 +3,14 @@ package com.l2jserver.model.world.clan; import com.l2jserver.model.world.Clan; import com.l2jserver.model.world.event.WorldEvent; +/** + * Base event for {@link Clan} objects + * + * @author Rogiel + */ public interface ClanEvent extends WorldEvent { + /** + * @return the clan + */ Clan getClan(); } diff --git a/src/main/java/com/l2jserver/model/world/clan/ClanListener.java b/src/main/java/com/l2jserver/model/world/clan/ClanListener.java index 1c753aff5..bf79e5505 100644 --- a/src/main/java/com/l2jserver/model/world/clan/ClanListener.java +++ b/src/main/java/com/l2jserver/model/world/clan/ClanListener.java @@ -2,5 +2,10 @@ package com.l2jserver.model.world.clan; import com.l2jserver.model.world.event.WorldListener; +/** + * Base listener for {@link ClanEvent} + * + * @author Rogiel + */ public interface ClanListener extends WorldListener { } diff --git a/src/main/java/com/l2jserver/model/world/clan/ClanMembers.java b/src/main/java/com/l2jserver/model/world/clan/ClanMembers.java index 001089f89..f4881cdf0 100644 --- a/src/main/java/com/l2jserver/model/world/clan/ClanMembers.java +++ b/src/main/java/com/l2jserver/model/world/clan/ClanMembers.java @@ -26,6 +26,12 @@ public class ClanMembers implements Iterable { private final Set members = CollectionFactory .newSet(CharacterID.class); + /** + * Creates a new instance + * + * @param clan + * the clan + */ public ClanMembers(Clan clan) { this.clan = clan; } diff --git a/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java b/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java index 8a8954ce8..f585a7cae 100644 --- a/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java +++ b/src/main/java/com/l2jserver/model/world/event/SpawnEvent.java @@ -3,7 +3,13 @@ package com.l2jserver.model.world.event; import com.l2jserver.model.world.capability.Spawnable; import com.l2jserver.util.Coordinate; +/** + * Event for objects spawning + * + * @author Rogiel + */ public interface SpawnEvent extends WorldEvent { + @Override Spawnable getObject(); Coordinate getCoordinate(); diff --git a/src/main/java/com/l2jserver/model/world/event/WorldEvent.java b/src/main/java/com/l2jserver/model/world/event/WorldEvent.java index e580ffd90..add525d55 100644 --- a/src/main/java/com/l2jserver/model/world/event/WorldEvent.java +++ b/src/main/java/com/l2jserver/model/world/event/WorldEvent.java @@ -4,7 +4,13 @@ import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.capability.Listenable; public interface WorldEvent { + /** + * @return the object that issued this event + */ WorldObject getObject(); + /** + * @return the list of objects that will be notified of this event + */ Listenable[] getDispatchableObjects(); } diff --git a/src/main/java/com/l2jserver/model/world/filter/AndFilter.java b/src/main/java/com/l2jserver/model/world/filter/AndFilter.java index 7e5fab92b..fbf959fb5 100644 --- a/src/main/java/com/l2jserver/model/world/filter/AndFilter.java +++ b/src/main/java/com/l2jserver/model/world/filter/AndFilter.java @@ -2,9 +2,27 @@ package com.l2jserver.model.world.filter; import com.l2jserver.model.world.WorldObject; +/** + * AND filter that accepts all values in which all other + * filters return true. + * + * @author Rogiel + * + * @param + * the item type + */ public class AndFilter implements WorldObjectFilter { + /** + * The filters + */ private WorldObjectFilter[] filters; + /** + * Creates a new instance + * + * @param filters + * filters to be used with AND operator + */ public AndFilter(WorldObjectFilter... filters) { this.filters = filters; } diff --git a/src/main/java/com/l2jserver/model/world/filter/NotFilter.java b/src/main/java/com/l2jserver/model/world/filter/NotFilter.java index 44fafcd5c..a6bf12e8f 100644 --- a/src/main/java/com/l2jserver/model/world/filter/NotFilter.java +++ b/src/main/java/com/l2jserver/model/world/filter/NotFilter.java @@ -2,9 +2,27 @@ package com.l2jserver.model.world.filter; import com.l2jserver.model.world.WorldObject; +/** + * And filter that accepts all values in which the other filter return + * false. + * + * @author Rogiel + * + * @param + * the item type + */ public class NotFilter implements WorldObjectFilter { + /** + * The filter + */ private WorldObjectFilter filter; + /** + * Creates a new instance + * + * @param filter + * the filter + */ public NotFilter(WorldObjectFilter filter) { this.filter = filter; } diff --git a/src/main/java/com/l2jserver/model/world/filter/OrFilter.java b/src/main/java/com/l2jserver/model/world/filter/OrFilter.java index de02a4782..f85e9a725 100644 --- a/src/main/java/com/l2jserver/model/world/filter/OrFilter.java +++ b/src/main/java/com/l2jserver/model/world/filter/OrFilter.java @@ -2,9 +2,27 @@ package com.l2jserver.model.world.filter; import com.l2jserver.model.world.WorldObject; +/** + * OR filter that accepts all values in which at least one of the + * filters return true. + * + * @author Rogiel + * + * @param + * the item type + */ public class OrFilter implements WorldObjectFilter { + /** + * The filters + */ private WorldObjectFilter[] filters; + /** + * Creates a new instance + * + * @param filters + * filters to be used with OR operator + */ public OrFilter(WorldObjectFilter... filters) { this.filters = filters; } diff --git a/src/main/java/com/l2jserver/model/world/filter/WorldFilters.java b/src/main/java/com/l2jserver/model/world/filter/WorldFilters.java index 0104df905..0945f4e2e 100644 --- a/src/main/java/com/l2jserver/model/world/filter/WorldFilters.java +++ b/src/main/java/com/l2jserver/model/world/filter/WorldFilters.java @@ -2,18 +2,50 @@ package com.l2jserver.model.world.filter; import com.l2jserver.model.world.WorldObject; +/** + * Utility class for common filter types + * + * @author Rogiel + */ public final class WorldFilters { + /** + * Performs an AND operation + * + * @param + * the object type + * @param filters + * the filters + * @return the {@link AndFilter} + */ public static final WorldObjectFilter and( WorldObjectFilter... filters) { return new AndFilter(filters); } + /** + * Performs an OR operation + * + * @param + * the object type + * @param filters + * the filters + * @return the {@link OrFilter} + */ public static final WorldObjectFilter or( WorldObjectFilter... filters) { return new OrFilter(filters); } - public static final WorldObjectFilter notf( + /** + * Performs an NOTA operation + * + * @param + * the object type + * @param filters + * the filters + * @return the {@link NotFilter} + */ + public static final WorldObjectFilter not( WorldObjectFilter filter) { return new NotFilter(filter); } diff --git a/src/main/java/com/l2jserver/model/world/filter/impl/IDFilter.java b/src/main/java/com/l2jserver/model/world/filter/impl/IDFilter.java index ca379cd02..0f2e6ac72 100644 --- a/src/main/java/com/l2jserver/model/world/filter/impl/IDFilter.java +++ b/src/main/java/com/l2jserver/model/world/filter/impl/IDFilter.java @@ -4,9 +4,23 @@ import com.l2jserver.model.id.ID; import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.model.world.filter.WorldObjectFilter; +/** + * Filter objects based on its ID. + * + * @author Rogiel + */ public class IDFilter implements WorldObjectFilter { + /** + * The object id + */ private final ID id; + /** + * Creates a new instance + * + * @param id + * the desired object ID + */ public IDFilter(final ID id) { this.id = id; } diff --git a/src/main/java/com/l2jserver/model/world/filter/impl/InstanceFilter.java b/src/main/java/com/l2jserver/model/world/filter/impl/InstanceFilter.java index f693a05a3..2acd220db 100644 --- a/src/main/java/com/l2jserver/model/world/filter/impl/InstanceFilter.java +++ b/src/main/java/com/l2jserver/model/world/filter/impl/InstanceFilter.java @@ -3,10 +3,26 @@ package com.l2jserver.model.world.filter.impl; import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.filter.WorldObjectFilter; +/** + * Filter object based on their types + * + * @author Rogiel + * @param + * the instance type + */ public class InstanceFilter implements WorldObjectFilter { + /** + * The object's type + */ private final Class type; + /** + * Creates a new instance + * + * @param instance + * the instance type + */ public InstanceFilter(Class instance) { this.type = instance; } diff --git a/src/main/java/com/l2jserver/model/world/filter/impl/RangeFilter.java b/src/main/java/com/l2jserver/model/world/filter/impl/RangeFilter.java index 6fc2136e3..b5955c943 100644 --- a/src/main/java/com/l2jserver/model/world/filter/impl/RangeFilter.java +++ b/src/main/java/com/l2jserver/model/world/filter/impl/RangeFilter.java @@ -4,15 +4,42 @@ import com.l2jserver.model.world.capability.Positionable; import com.l2jserver.model.world.filter.WorldObjectFilter; import com.l2jserver.util.Coordinate; +/** + * Filter objects that are in the range of coordinate + * + * @author Rogiel + */ public class RangeFilter implements WorldObjectFilter { + /** + * The coordinate point + */ private final Coordinate coordinate; + /** + * The desired maximum distance of the object + */ private final int range; + /** + * Creates a new instance + * + * @param coordinate + * the coordinate as base for range search + * @param range + * the desired maximum distance of the object + */ public RangeFilter(final Coordinate coordinate, final int range) { this.coordinate = coordinate; this.range = range; } + /** + * Creates a new instance + * + * @param positionable + * the base object + * @param range + * the desired maximum distance of the object + */ public RangeFilter(final Positionable positionable, final int range) { this(positionable.getPosition(), range); } diff --git a/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java b/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java index 3d5b944f5..51482bdfb 100644 --- a/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java +++ b/src/main/java/com/l2jserver/model/world/item/ItemDropEvent.java @@ -7,10 +7,29 @@ import com.l2jserver.model.world.capability.Actor; import com.l2jserver.model.world.capability.Listenable; import com.l2jserver.model.world.player.PlayerEvent; +/** + * Event dispatched once an {@link Item} has been dropped on the ground. + * + * @author Rogiel + */ public class ItemDropEvent implements ItemEvent, PlayerEvent { + /** + * The dropping player + */ private final Player player; + /** + * The item dropped + */ private final Item item; + /** + * Creates a new instance of this event + * + * @param player + * the dropping player + * @param item + * the dropped item + */ public ItemDropEvent(Player player, Item item) { this.player = player; this.item = item; diff --git a/src/main/java/com/l2jserver/model/world/item/ItemEvent.java b/src/main/java/com/l2jserver/model/world/item/ItemEvent.java index 109d8d39e..6c8535f8d 100644 --- a/src/main/java/com/l2jserver/model/world/item/ItemEvent.java +++ b/src/main/java/com/l2jserver/model/world/item/ItemEvent.java @@ -3,6 +3,15 @@ package com.l2jserver.model.world.item; import com.l2jserver.model.world.Item; import com.l2jserver.model.world.event.WorldEvent; +/** + * Base event for items + * + * @author Rogiel + * + */ public interface ItemEvent extends WorldEvent { + /** + * @return the item + */ Item getItem(); } diff --git a/src/main/java/com/l2jserver/model/world/item/ItemListener.java b/src/main/java/com/l2jserver/model/world/item/ItemListener.java index 55d54d115..5bc6f1715 100644 --- a/src/main/java/com/l2jserver/model/world/item/ItemListener.java +++ b/src/main/java/com/l2jserver/model/world/item/ItemListener.java @@ -2,5 +2,10 @@ package com.l2jserver.model.world.item; import com.l2jserver.model.world.event.WorldListener; +/** + * Listener for {@link ItemEvent} + * + * @author Rogiel + */ public interface ItemListener extends WorldListener { } diff --git a/src/main/java/com/l2jserver/model/world/iterator/FilterIterator.java b/src/main/java/com/l2jserver/model/world/iterator/FilterIterator.java index 5829bf3c6..5b5bf5410 100644 --- a/src/main/java/com/l2jserver/model/world/iterator/FilterIterator.java +++ b/src/main/java/com/l2jserver/model/world/iterator/FilterIterator.java @@ -5,12 +5,38 @@ import java.util.Iterator; import com.l2jserver.model.world.WorldObject; import com.l2jserver.model.world.filter.WorldObjectFilter; +/** + * The {@link FilterIterator} takes an {@link WorldObject} and a + * {@link WorldObjectFilter} and dynamically iterates over the items and find + * the next matching object. + * + * @author Rogiel + * + * @param + * the object type + */ public class FilterIterator implements Iterator { + /** + * The unfiltered object iterator + */ private final Iterator objects; + /** + * The filter + */ private final WorldObjectFilter filter; - + /** + * The next object found + */ private O selected; + /** + * Creates a new instance + * + * @param filter + * the filter + * @param objects + * the unfiltered object iterator + */ public FilterIterator(final WorldObjectFilter filter, Iterator objects) { this.filter = filter; @@ -36,7 +62,12 @@ public class FilterIterator implements Iterator { public void remove() { } - public O findNext() { + /** + * Locates the next matching object + * + * @return the next matching object + */ + private O findNext() { if (selected != null) return selected; while (objects.hasNext()) { diff --git a/src/main/java/com/l2jserver/model/world/party/PartyEvent.java b/src/main/java/com/l2jserver/model/world/party/PartyEvent.java index 29f232275..7a7b82755 100644 --- a/src/main/java/com/l2jserver/model/world/party/PartyEvent.java +++ b/src/main/java/com/l2jserver/model/world/party/PartyEvent.java @@ -1,8 +1,14 @@ package com.l2jserver.model.world.party; import com.l2jserver.model.world.Clan; +import com.l2jserver.model.world.Party; import com.l2jserver.model.world.event.WorldEvent; +/** + * Base event for {@link Party} objects + * + * @author Rogiel + */ public interface PartyEvent extends WorldEvent { Clan getClan(); } diff --git a/src/main/java/com/l2jserver/model/world/party/PartyListener.java b/src/main/java/com/l2jserver/model/world/party/PartyListener.java index d0739e43e..ce9aac527 100644 --- a/src/main/java/com/l2jserver/model/world/party/PartyListener.java +++ b/src/main/java/com/l2jserver/model/world/party/PartyListener.java @@ -2,5 +2,10 @@ package com.l2jserver.model.world.party; import com.l2jserver.model.world.event.WorldListener; +/** + * Listener for {@link PartyEvent} + * + * @author Rogiel + */ public interface PartyListener extends WorldListener { } diff --git a/src/main/java/com/l2jserver/model/world/player/PlayerEvent.java b/src/main/java/com/l2jserver/model/world/player/PlayerEvent.java index c51b14533..087f3e50a 100644 --- a/src/main/java/com/l2jserver/model/world/player/PlayerEvent.java +++ b/src/main/java/com/l2jserver/model/world/player/PlayerEvent.java @@ -3,6 +3,14 @@ package com.l2jserver.model.world.player; import com.l2jserver.model.world.Player; import com.l2jserver.model.world.actor.ActorEvent; +/** + * Base event for {@link Player} objects + * + * @author Rogiel + */ public interface PlayerEvent extends ActorEvent { + /** + * @return the player + */ Player getPlayer(); } diff --git a/src/main/java/com/l2jserver/model/world/player/PlayerListener.java b/src/main/java/com/l2jserver/model/world/player/PlayerListener.java index e8937edd8..e54c02082 100644 --- a/src/main/java/com/l2jserver/model/world/player/PlayerListener.java +++ b/src/main/java/com/l2jserver/model/world/player/PlayerListener.java @@ -5,6 +5,11 @@ import com.l2jserver.model.world.actor.ActorListener; import com.l2jserver.model.world.event.WorldEvent; import com.l2jserver.model.world.event.WorldListener; +/** + * Listener for {@link PlayerEvent} + * + * @author Rogiel + */ public abstract class PlayerListener implements ActorListener { @Override public boolean dispatch(ActorEvent e) { diff --git a/src/main/java/com/l2jserver/model/world/player/PlayerSpawnEvent.java b/src/main/java/com/l2jserver/model/world/player/PlayerSpawnEvent.java index ba42efc6e..1fd5edbec 100644 --- a/src/main/java/com/l2jserver/model/world/player/PlayerSpawnEvent.java +++ b/src/main/java/com/l2jserver/model/world/player/PlayerSpawnEvent.java @@ -7,10 +7,29 @@ import com.l2jserver.model.world.capability.Spawnable; import com.l2jserver.model.world.event.SpawnEvent; import com.l2jserver.util.Coordinate; +/** + * Event dispatcher once an player has spawned in the world + * + * @author Rogiel + */ public class PlayerSpawnEvent implements PlayerEvent, SpawnEvent { + /** + * The spawned player + */ private final Player player; + /** + * The spawning coordinate + */ private final Coordinate coordinate; + /** + * Creates a new instance + * + * @param player + * the spawned player + * @param coordinate + * the spawn coordinate + */ public PlayerSpawnEvent(Player player, Coordinate coordinate) { this.player = player; this.coordinate = coordinate; diff --git a/src/main/java/com/l2jserver/model/world/player/PlayerTeleportEvent.java b/src/main/java/com/l2jserver/model/world/player/PlayerTeleportEvent.java index aa446755f..0cfbc8ab3 100644 --- a/src/main/java/com/l2jserver/model/world/player/PlayerTeleportEvent.java +++ b/src/main/java/com/l2jserver/model/world/player/PlayerTeleportEvent.java @@ -3,7 +3,20 @@ package com.l2jserver.model.world.player; import com.l2jserver.model.world.Player; import com.l2jserver.util.Coordinate; +/** + * Event dispatched once an player is teleported. + * + * @author Rogiel + */ public class PlayerTeleportEvent extends PlayerSpawnEvent { + /** + * Creates a new instance + * + * @param player + * the teleported player + * @param coordinate + * the coordinate + */ public PlayerTeleportEvent(Player player, Coordinate coordinate) { super(player, coordinate); } diff --git a/src/main/java/com/l2jserver/model/world/player/TestEvent.java b/src/main/java/com/l2jserver/model/world/player/TestEvent.java deleted file mode 100644 index 5035a9280..000000000 --- a/src/main/java/com/l2jserver/model/world/player/TestEvent.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.l2jserver.model.world.player; - -import com.l2jserver.model.world.event.WorldEvent; - -public interface TestEvent extends WorldEvent { -} diff --git a/src/main/java/com/l2jserver/routines/GameServerInitializationRoutine.java b/src/main/java/com/l2jserver/routines/GameServerInitializationRoutine.java index 46df5662e..7424ee7e9 100644 --- a/src/main/java/com/l2jserver/routines/GameServerInitializationRoutine.java +++ b/src/main/java/com/l2jserver/routines/GameServerInitializationRoutine.java @@ -8,9 +8,23 @@ import com.l2jserver.service.game.scripting.ScriptingService; import com.l2jserver.service.game.template.TemplateService; import com.l2jserver.service.network.NetworkService; +/** + * Routine used to initialize the server. Starts all services. + * + * @author Rogiel + */ public class GameServerInitializationRoutine implements Routine { + /** + * The service manager + */ private final ServiceManager serviceManager; + /** + * Creates a new instance + * + * @param serviceManager + * the service manager + */ @Inject public GameServerInitializationRoutine(ServiceManager serviceManager) { this.serviceManager = serviceManager; diff --git a/src/main/java/com/l2jserver/routines/Routine.java b/src/main/java/com/l2jserver/routines/Routine.java index ee66b9b80..a4de09569 100644 --- a/src/main/java/com/l2jserver/routines/Routine.java +++ b/src/main/java/com/l2jserver/routines/Routine.java @@ -2,5 +2,13 @@ package com.l2jserver.routines; import java.util.concurrent.Callable; +/** + * An routine is a set of operations that can be performed on another thread. + * + * @author Rogiel + * + * @param + * the routine return type + */ public interface Routine extends Callable { } diff --git a/src/test/java/com/l2jserver/model/id/factory/IDFactoryTest.java b/src/test/java/com/l2jserver/model/id/factory/IDFactoryTest.java index e3cf26d76..c950a21dc 100644 --- a/src/test/java/com/l2jserver/model/id/factory/IDFactoryTest.java +++ b/src/test/java/com/l2jserver/model/id/factory/IDFactoryTest.java @@ -9,6 +9,7 @@ import com.google.inject.Guice; import com.google.inject.Injector; import com.l2jserver.db.dao.DAOModuleMySQL5; import com.l2jserver.model.id.ID; +import com.l2jserver.model.id.factory.IDFactoryModule; import com.l2jserver.model.id.object.CharacterID; import com.l2jserver.model.id.object.factory.CharacterIDFactory; import com.l2jserver.model.world.L2Character;