public static List<WorldObject> getOwnedCattle(WorldObject performer, World world) {
   int id = performer.getProperty(Constants.ID);
   List<WorldObject> ownedCattle =
       world.findWorldObjectsByProperty(
           Constants.MEAT_SOURCE,
           w ->
               w.getProperty(Constants.CATTLE_OWNER_ID) != null
                   && w.getProperty(Constants.CATTLE_OWNER_ID).intValue() == id);
   return ownedCattle;
 }
예제 #2
0
 private List<WorldObject> getNonMembersSellingItems(WorldObject performer, World world) {
   List<WorldObject> organizations =
       GroupPropertyUtils.findOrganizationsUsingLeader(performer, world);
   Profession profession = performer.getProperty(Constants.PROFESSION);
   if (profession != null) {
     List<Item> itemsSoldByProfession = profession.getSellItems();
     for (WorldObject organization : organizations) {
       return world.findWorldObjectsByProperty(
           Constants.STRENGTH, w -> nonMemberSoldItem(organization, w, itemsSoldByProfession));
     }
   }
   return new ArrayList<>();
 }