Exemplo n.º 1
0
 @Override
 public OperationInfo calculateGoal(WorldObject performer, World world) {
   List<WorldObject> targets = findPotentialTargets(performer, world);
   if (targets.size() > 0) {
     return new OperationInfo(
         performer,
         targets.get(0),
         Conversations.createArgs(Conversations.SWITCH_DEITY_CONVERSATION),
         Actions.TALK_ACTION);
   } else {
     return null;
   }
 }
Exemplo n.º 2
0
 @Override
 public OperationInfo calculateGoal(WorldObject performer, World world) {
   for (WorldObject nonMember : getNonMembersSellingItems(performer, world)) {
     boolean actionAlreadyPerformed =
         world
                 .getHistory()
                 .findHistoryItems(
                     performer,
                     nonMember,
                     Conversations.createArgs(Conversations.STOP_SELLING_CONVERSATION),
                     Actions.TALK_ACTION)
                 .size()
             > 0;
     if (!actionAlreadyPerformed) {
       return new OperationInfo(
           performer,
           nonMember,
           Conversations.createArgs(Conversations.STOP_SELLING_CONVERSATION),
           Actions.TALK_ACTION);
     }
   }
   return null;
 }