Added new method of listening for intents

This commit is contained in:
Obique PSWG
2017-01-08 20:56:02 -06:00
parent 2a6dc98b3a
commit ab2bbc897f
12 changed files with 115 additions and 280 deletions
+1 -12
View File
@@ -40,7 +40,6 @@ import java.util.Map;
import resources.Location;
import resources.control.Assert;
import resources.control.Intent;
import resources.control.Service;
import resources.objects.SWGObject;
import resources.objects.building.BuildingObject;
@@ -68,17 +67,7 @@ public class StaticService extends Service {
getSupportingStatement = spawnDatabase.prepareStatement(GET_SUPPORTING_SQL);
spawnableObjects = new HashMap<>();
registerForIntent(ObjectCreatedIntent.TYPE);
}
@Override
public void onIntentReceived(Intent i) {
switch (i.getType()) {
case ObjectCreatedIntent.TYPE:
if (i instanceof ObjectCreatedIntent)
createSupportingObjects(((ObjectCreatedIntent) i).getObject());
break;
}
registerForIntent(ObjectCreatedIntent.class, oci -> createSupportingObjects(oci.getObject()));
}
private void createSupportingObjects(SWGObject object) {