mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-08 08:23:11 +00:00
Change-Id: I375a10c9d7ce56df457a998e5cb9d02465865973
This commit is contained in:
144
src/main/java/com/l2jserver/model/world/AbstractActor.java
Normal file
144
src/main/java/com/l2jserver/model/world/AbstractActor.java
Normal file
@@ -0,0 +1,144 @@
|
||||
package com.l2jserver.model.world;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.l2jserver.model.template.SkillTemplate;
|
||||
import com.l2jserver.model.template.capability.Attackable;
|
||||
import com.l2jserver.model.world.actor.ActorEvent;
|
||||
import com.l2jserver.model.world.actor.ActorListener;
|
||||
import com.l2jserver.model.world.capability.Actor;
|
||||
import com.l2jserver.model.world.capability.Attacker;
|
||||
import com.l2jserver.model.world.capability.Castable;
|
||||
import com.l2jserver.model.world.capability.Equipable;
|
||||
import com.l2jserver.model.world.capability.Equiper;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
|
||||
public abstract class AbstractActor extends AbstractObject implements Actor {
|
||||
private final List<ActorListener> listeners = CollectionFactory
|
||||
.newList(ActorListener.class);
|
||||
|
||||
protected int level;
|
||||
protected int hp;
|
||||
protected Coordinate position;
|
||||
|
||||
@Override
|
||||
public void receiveDamage(int damage) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHP() {
|
||||
return hp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHP(int hp) {
|
||||
this.hp = hp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveAttack(Attacker attacker, Attackable weapon) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void attack(com.l2jserver.model.world.capability.Attackable target,
|
||||
Attackable weapon) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cast() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cast(SkillTemplate skill, Castable cast) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawn(Coordinate coordinate) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSpawned() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Coordinate getPosition() {
|
||||
return position;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPosition(Coordinate coord) {
|
||||
this.position = coord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void die(WorldObject killer) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void equip(Equipable equipable) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEquiped(Equipable equipment) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEquiped(
|
||||
com.l2jserver.model.template.capability.Equipable equipable) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEquipment(Object slot, Equipable equipment) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getEquipment(Object slot) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void equip(Equiper equiper) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addListener(ActorListener listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeListener(ActorListener listener) {
|
||||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispatch(ActorEvent e) {
|
||||
for (final ActorListener listener : listeners) {
|
||||
listener.dispatch(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.l2jserver.model.world.actor;
|
||||
|
||||
import com.l2jserver.model.world.capability.Actor;
|
||||
import com.l2jserver.model.world.event.WorldEvent;
|
||||
|
||||
public interface ActorEvent extends WorldEvent {
|
||||
Actor getActor();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.l2jserver.model.world.actor;
|
||||
|
||||
import com.l2jserver.model.world.event.WorldListener;
|
||||
|
||||
public interface ActorListener extends WorldListener<ActorEvent> {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.model.world.actor.ActorEvent;
|
||||
import com.l2jserver.model.world.actor.ActorListener;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that defines an Actor (NPC, player, pet,
|
||||
* etc...)
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Actor extends Listenable<ActorListener, ActorEvent>,
|
||||
Spawnable, Positionable, Damagable, Attackable, Attacker, Castable,
|
||||
Caster, Levelable, Killable, Equiper, Equipable {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can become invisible to other objects.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Invisible extends ObjectCapability {
|
||||
boolean isInvisible();
|
||||
|
||||
void setInvisible();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can talk to an {@link Conversable}.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Talker extends ObjectCapability {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can be teleported by
|
||||
* {@link Teleporter} objects. Note that it is also possible to teleport
|
||||
* <b>without</b> a teleporter!
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Teleportable extends ObjectCapability, Positionable, Spawnable {
|
||||
void teleport(Coordinate coordinate);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.l2jserver.model.world.capability;
|
||||
|
||||
import com.l2jserver.model.world.AbstractObject;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
/**
|
||||
* Defines an {@link AbstractObject} that can teleport {@link Teleportable}
|
||||
* objects.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface Teleporter extends ObjectCapability {
|
||||
void teleport(Coordinate coord, Teleportable target);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.l2jserver.model.world.player;
|
||||
|
||||
import com.l2jserver.model.world.Player;
|
||||
import com.l2jserver.util.Coordinate;
|
||||
|
||||
public class PlayerTeleportEvent extends PlayerSpawnEvent {
|
||||
public PlayerTeleportEvent(Player player, Coordinate coordinate) {
|
||||
super(player, coordinate);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user