mirror of
https://github.com/ProjectSWGCore/Holocore.git
synced 2026-08-01 02:15:58 -04:00
Created a TicketPurchaseIntent which is broadcasted upon purchasing a ticket
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
var execute = function(galManager, player, target, args) {
|
||||
var TicketPurchaseIntent = Java.type("intents.travel.TicketPurchaseIntent");
|
||||
params = args.split(" ");
|
||||
|
||||
destinationPlanet = params[2];
|
||||
destinationName = params[3].replaceAll("_", " ");
|
||||
roundTrip = params[4].equals("1");
|
||||
|
||||
new TicketPurchaseIntent(player.getCreatureObject(), destinationPlanet, destinationName, roundTrip).broadcast();
|
||||
};
|
||||
@@ -0,0 +1,39 @@
|
||||
package intents.travel;
|
||||
|
||||
import resources.control.Intent;
|
||||
import resources.objects.creature.CreatureObject;
|
||||
|
||||
public final class TicketPurchaseIntent extends Intent {
|
||||
|
||||
public static final String TYPE = "TicketPurchaseIntent";
|
||||
|
||||
private final CreatureObject purchaser;
|
||||
private final boolean roundTrip;
|
||||
private final String destinationName;
|
||||
private final String destinationPlanet;
|
||||
|
||||
public TicketPurchaseIntent(CreatureObject purchaser, String destinationPlanet, String destinationName, boolean roundTrip) {
|
||||
super(TYPE);
|
||||
this.purchaser = purchaser;
|
||||
this.destinationPlanet = destinationPlanet;
|
||||
this.destinationName = destinationName;
|
||||
this.roundTrip = roundTrip;
|
||||
}
|
||||
|
||||
public CreatureObject getPurchaser() {
|
||||
return purchaser;
|
||||
}
|
||||
|
||||
public boolean isRoundTrip() {
|
||||
return roundTrip;
|
||||
}
|
||||
|
||||
public String getDestinationPlanet() {
|
||||
return destinationPlanet;
|
||||
}
|
||||
|
||||
public String getDestinationName() {
|
||||
return destinationName;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user