mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-17 04:22:47 +00:00
First commit
Change-Id: I4d273faba7286288d2b9a214c87c39a76724d787
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can receive attacks from an
|
||||
* {@link Attacker}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Attackable extends WorldCapability {
|
||||
void receiveAttack(Attacker attacker);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can attack an {@link Attackable}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Attacker extends WorldCapability {
|
||||
void attack(Attackable target);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can receive skill castings.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Castable extends WorldCapability {
|
||||
void cast();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.template.SkillTemplate;
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can cast skills.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Caster extends WorldCapability {
|
||||
void cast(SkillTemplate skill, Castable cast);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that is a child of another
|
||||
* {@link AbstractObject}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Child<P extends Parent> extends WorldCapability {
|
||||
public P getParent();
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that an player can talk to.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Conversable extends WorldCapability {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be dropped on the ground.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Dropable extends WorldCapability {
|
||||
void drop();
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be enchanted.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Enchantable extends WorldCapability {
|
||||
public int getEnchantLevel();
|
||||
|
||||
public int setEnchantLevel();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be equipped into an
|
||||
* {@link Equiper}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Equipable extends WorldCapability {
|
||||
void equip(Equiper equiper);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be equipped with {@link Equipable}
|
||||
* instances.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Equiper extends WorldCapability {
|
||||
void equip(Equipable equipable);
|
||||
|
||||
void setEquipment(Object slot, Equipable equipment);
|
||||
|
||||
void getEquipment(Object slot);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.model.world.event.WorldEvent;
|
||||
import com.l2jserver.model.world.event.WorldListener;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can attach {@link WorldListener} that
|
||||
* notifies of events on that object.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*
|
||||
* @param <L>
|
||||
* the listener type
|
||||
* @param <E>
|
||||
* the event type
|
||||
*/
|
||||
public interface Listenable<L extends WorldListener<E>, E extends WorldEvent>
|
||||
extends WorldCapability {
|
||||
void addListener(L listener);
|
||||
|
||||
void removeListener(L listener);
|
||||
|
||||
List<L> getListeners();
|
||||
|
||||
boolean support(Class<? extends E> eventType);
|
||||
|
||||
void dispatch(E e);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that is the parent of another
|
||||
* {@link AbstractObject}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Parent extends WorldCapability {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be played (i.e. controlled by the
|
||||
* player)
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Playable extends WorldCapability {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be positioned in the world.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Positionable extends WorldCapability {
|
||||
Coordinate getPosition();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.service.game.script.Script;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be controller by an {@link Script}
|
||||
* implementation.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Scriptable extends WorldCapability {
|
||||
/**
|
||||
* The the current script attached to this object
|
||||
*
|
||||
* @return the attached script
|
||||
*/
|
||||
Script<Scriptable> getScript();
|
||||
|
||||
/**
|
||||
* Set the attached script to this object
|
||||
*
|
||||
* @param script
|
||||
* the script
|
||||
*/
|
||||
void setScript(Script<Scriptable> script);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Represents an {@link AbstractObject} that can be spawned.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Spawnable extends WorldCapability, Positionable {
|
||||
void spawn(Coordinate coordinate);
|
||||
|
||||
boolean isSpawned();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Represents an {@link AbstractObject} that can be summoned.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Summunable extends Spawnable {
|
||||
void summon(Coordinate coordinate);
|
||||
|
||||
boolean isSummoned();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.model.world.WorldObject;
|
||||
|
||||
/**
|
||||
* Defines an base interface for all capabilities for {@link AbstractObject}
|
||||
* instances. No implementing class need to implement this interface.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface WorldCapability extends WorldObject {
|
||||
}
|
||||
Reference in New Issue
Block a user