mirror of
https://bitbucket.org/projectswg/cucore.git
synced 2026-07-13 20:00:58 -04:00
Created a DestroyObjectIntent
This commit is contained in:
@@ -35,6 +35,7 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import intents.object.DestroyObjectIntent;
|
||||
import intents.object.ObjectCreatedIntent;
|
||||
import intents.object.ObjectTeleportIntent;
|
||||
import intents.player.DeleteCharacterIntent;
|
||||
@@ -92,6 +93,7 @@ public class ObjectManager extends Manager {
|
||||
registerForIntent(GalacticPacketIntent.TYPE);
|
||||
registerForIntent(ObjectTeleportIntent.TYPE);
|
||||
registerForIntent(ObjectCreatedIntent.TYPE);
|
||||
registerForIntent(DestroyObjectIntent.TYPE);
|
||||
registerForIntent(DeleteCharacterIntent.TYPE);
|
||||
}
|
||||
|
||||
@@ -174,12 +176,23 @@ public class ObjectManager extends Manager {
|
||||
|
||||
@Override
|
||||
public void onIntentReceived(Intent i) {
|
||||
if (i instanceof GalacticPacketIntent) {
|
||||
processGalacticPacketIntent((GalacticPacketIntent) i);
|
||||
} else if (i instanceof ObjectCreatedIntent) {
|
||||
processObjectCreatedIntent((ObjectCreatedIntent) i);
|
||||
} else if (i instanceof DeleteCharacterIntent) {
|
||||
deleteObject(((DeleteCharacterIntent) i).getCreature().getObjectId());
|
||||
switch (i.getType()) {
|
||||
case GalacticPacketIntent.TYPE:
|
||||
if (i instanceof GalacticPacketIntent)
|
||||
processGalacticPacketIntent((GalacticPacketIntent) i);
|
||||
break;
|
||||
case ObjectCreatedIntent.TYPE:
|
||||
if (i instanceof ObjectCreatedIntent)
|
||||
processObjectCreatedIntent((ObjectCreatedIntent) i);
|
||||
break;
|
||||
case DestroyObjectIntent.TYPE:
|
||||
if (i instanceof DestroyObjectIntent)
|
||||
processDestroyObjectIntent((DestroyObjectIntent) i);
|
||||
break;
|
||||
case DeleteCharacterIntent.TYPE:
|
||||
if (i instanceof DeleteCharacterIntent)
|
||||
deleteObject(((DeleteCharacterIntent) i).getCreature().getObjectId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -187,6 +200,10 @@ public class ObjectManager extends Manager {
|
||||
putObject(intent.getObject());
|
||||
}
|
||||
|
||||
private void processDestroyObjectIntent(DestroyObjectIntent doi) {
|
||||
destroyObject(doi.getObject());
|
||||
}
|
||||
|
||||
private void processGalacticPacketIntent(GalacticPacketIntent gpi) {
|
||||
Packet packet = gpi.getPacket();
|
||||
if (packet instanceof SelectCharacter) {
|
||||
|
||||
Reference in New Issue
Block a user