26 public boolean execute(String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
28 String personId = params.get(0).getString(memoryMap);
29 String marketId =
null;
30 if (params.size() > 1) {
31 marketId = params.get(1).getString(memoryMap);
34 SectorEntityToken entity = dialog.getInteractionTarget();
36 MarketAPI market =
null;
37 if (entity !=
null) market = entity.getMarket();
38 if (marketId !=
null) {
41 if (market ==
null &&
"ga_market".equals(marketId)) {
42 market =
Global.
getSector().getImportantPeople().getPerson(People.BAIRD).getMarket();
45 if (market ==
null)
return false;
47 PersonAPI person =
null;
48 PersonDataAPI data =
Global.
getSector().getImportantPeople().getData(personId);
49 if (data !=
null) person = data.getPerson();
51 if (person ==
null && entity !=
null) {
52 person = entity.getActivePerson();
54 if (person ==
null)
return false;
56 Misc.moveToMarket(person, market,
false);