mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-10-14 04:13:11 -04:00
Cleaned up CorpseService a bit
This commit is contained in:
@@ -49,14 +49,10 @@ import utilities.ThreadUtilities;
|
||||
public final class CorpseService extends Service {
|
||||
|
||||
private final ScheduledExecutorService executor;
|
||||
// TODO Map terrain to all cloning facilities for that terrain
|
||||
// TODO cloning facilities with factional restrictions
|
||||
|
||||
public CorpseService() {
|
||||
executor = Executors.newSingleThreadScheduledExecutor(ThreadUtilities.newThreadFactory("corpse-service"));
|
||||
registerForIntent(CreatureKilledIntent.TYPE);
|
||||
// TODO register for PlayerEventIntent
|
||||
// TODO register for ObjectCreatedIntent
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,7 +65,6 @@ public final class CorpseService extends Service {
|
||||
public void onIntentReceived(Intent i) {
|
||||
switch(i.getType()) {
|
||||
case CreatureKilledIntent.TYPE: handleCreatureKilledIntent((CreatureKilledIntent) i); break;
|
||||
case PlayerEventIntent.TYPE: handlePlayerEventIntent((PlayerEventIntent) i); break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,24 +82,6 @@ public final class CorpseService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
private void handlePlayerEventIntent(PlayerEventIntent i) {
|
||||
switch(i.getEvent()) {
|
||||
case PE_DISAPPEAR: handleDisappearedPlayer(i.getPlayer()); break;
|
||||
}
|
||||
}
|
||||
|
||||
private void handleDisappearedPlayer(Player player) {
|
||||
CreatureObject disappearedCreature = player.getCreatureObject();
|
||||
|
||||
switch(disappearedCreature.getPosture()) {
|
||||
case DEAD:
|
||||
// If a player is dead when they disappear, we force them to clone at the nearest facility
|
||||
// TODO cancel currently scheduled forced clone
|
||||
// TODO force clone
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Only used for NPCs!
|
||||
* @param creatureCorpse non-player creature to delete from the world
|
||||
|
||||
Reference in New Issue
Block a user