def increment_data(self, data_object, guid, objective_test, resolver):
     sim = resolver.sim_info.get_sim_instance()
     if sim is None:
         return results.TestResultNumeric(
             False,
             "Couldn't find sim instance.",
             current_value=data_object.get_objective_count(guid),
             goal_value=self.iterations_required_to_pass,
             is_money=False)
     user_facing_situation_id = 0
     for situation in services.get_zone_situation_manager(
     ).get_situations_sim_is_in(sim):
         while situation.is_user_facing:
             user_facing_situation_id = situation.id
             break
     if user_facing_situation_id == 0:
         return results.TestResultNumeric(
             False,
             'Sim is not currently in a situation.',
             current_value=data_object.get_objective_count(guid),
             goal_value=self.iterations_required_to_pass,
             is_money=False)
     if user_facing_situation_id != self.current_situation_id:
         self.current_situation_id = user_facing_situation_id
         data_object.reset_objective_count(guid)
     data_object.increment_objective_count(guid)
     num_of_iterations = data_object.get_objective_count(guid)
     if num_of_iterations < self.iterations_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=num_of_iterations,
             goal_value=self.iterations_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
 def _get_current_iterations_test_result(cls, objective_data):
     return results.TestResultNumeric(
         False,
         'Objective: not enough iterations.',
         current_value=objective_data.get_objective_count(cls.guid64),
         goal_value=cls.objective_completion_type.get_number_required(),
         is_money=False)
 def increment_data(cls, resolver):
     return results.TestResultNumeric(
         False,
         "Objective doesn't have a tuned completion type.",
         current_value=0,
         goal_value=cls.goal_value(),
         is_money=cls.is_goal_value_money)
 def increment_data(self, data_object, guid, objective_test, resolver):
     data_object.increment_objective_count(guid)
     num_of_iterations = data_object.get_objective_count(guid)
     return results.TestResultNumeric(
         False,
         'Objective: not possible because sim info panel member.',
         current_value=num_of_iterations,
         goal_value=0,
         is_money=False)
 def increment_data(self, data_object, guid, objective_test, resolver):
     data_object.increment_objective_count(guid)
     num_of_iterations = data_object.get_objective_count(guid)
     if num_of_iterations < self.iterations_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=num_of_iterations,
             goal_value=self.iterations_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result and additional_result:
         sim = resolver.sim_info.get_sim_instance()
         if sim is None:
             return results.TestResultNumeric(
                 False,
                 "Objective: Couldn't find sim instance.",
                 current_value=data_object.get_objective_count(objective),
                 goal_value=self.iterations_required_to_pass,
                 is_money=False)
         user_facing_situation_id = 0
         for situation in services.get_zone_situation_manager(
         ).get_situations_sim_is_in(sim):
             if situation.is_user_facing:
                 user_facing_situation_id = situation.id
                 break
         if user_facing_situation_id == 0:
             return results.TestResultNumeric(
                 False,
                 'Objective: Sim is not currently in a situation.',
                 current_value=data_object.get_objective_count(objective),
                 goal_value=self.iterations_required_to_pass,
                 is_money=False)
         if user_facing_situation_id != self.current_situation_id:
             self.current_situation_id = user_facing_situation_id
             data_object.reset_objective_count(objective)
         data_object.add_objective_value(objective, 1)
         self.on_increment_objective_data(event_data_tracker)
     count = data_object.get_objective_count(objective)
     if count < self.iterations_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=count,
             goal_value=self.iterations_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result and additional_result:
         data_object.add_objective_value(objective, 1)
         self.on_increment_objective_data(event_data_tracker)
     count = data_object.get_objective_count(objective)
     return results.TestResultNumeric(
         False,
         'Objective: not possible because sim info panel member.',
         current_value=count,
         goal_value=0,
         is_money=False)
 def increment_data(self, data_object, guid, objective_test, resolver):
     lot_id = services.get_zone(resolver.sim_info.zone_id).lot.lot_id
     if lot_id is not None:
         data_object.add_objective_id(guid, lot_id)
     num_of_iterations = data_object.get_objective_count(guid)
     if num_of_iterations < self.unique_locations_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough matching location iterations.',
             current_value=num_of_iterations,
             goal_value=self.unique_locations_required_to_pass,
             is_money=False)
     data_object.set_objective_complete(guid)
     return results.TestResult.TRUE
 def increment_data(self, data_object, guid, objective_test, resolver):
     posture_id = resolver.get_posture_id(objective_test)
     if posture_id is not None:
         data_object.add_objective_id(guid, posture_id)
     num_of_iterations = data_object.get_objective_count(guid)
     if num_of_iterations < self.unique_postures_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=num_of_iterations,
             goal_value=self.unique_postures_required_to_pass,
             is_money=False)
     data_object.set_objective_complete(guid)
     return results.TestResult.TRUE
Example #10
0
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result and additional_result:
         data_object.add_objective_value(objective, 1)
         self.on_increment_objective_data(event_data_tracker)
     count = data_object.get_objective_count(objective)
     if count < self.get_number_required(objective.objective_test):
         return results.TestResultNumeric(
             False,
             'Objective: not possible because sim info panel member.',
             current_value=count,
             goal_value=self.iterations_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
Example #11
0
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result and additional_result:
         data_object.add_objective_value(objective,
                                         resolver.sim_info.zone_id)
         self.on_increment_objective_data(event_data_tracker)
     count = data_object.get_objective_count(objective)
     if count < self.unique_locations_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough matching location iterations.',
             current_value=count,
             goal_value=self.unique_locations_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
 def increment_data(self, data_object, guid, objective_test, resolver):
     tags_to_test = resolver.get_tags(objective_test)
     for tag_from_test in tags_to_test:
         for tag_from_objective in self.tag_checklist:
             while tag_from_test is tag_from_objective:
                 data_object.add_objective_id(guid, tag_from_objective)
                 break
     num_of_iterations = data_object.get_objective_count(guid)
     if num_of_iterations < self.unique_tags_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=num_of_iterations,
             goal_value=self.unique_tags_required_to_pass,
             is_money=False)
     data_object.set_objective_complete(guid)
     return results.TestResult.TRUE
Example #13
0
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result and additional_result:
         target_id = resolver.get_target_id(objective.objective_test,
                                            self.id_to_check)
         if target_id is not None:
             data_object.add_objective_value(objective, target_id)
             self.on_increment_objective_data(event_data_tracker)
     count = data_object.get_objective_count(objective)
     if count < self.unique_targets_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=count,
             goal_value=self.unique_targets_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
Example #14
0
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result and additional_result:
         zone_id = resolver.sim_info.zone_id
         world_id = services.get_persistence_service(
         ).get_world_id_from_zone(zone_id)
         world_desc_id = services.get_world_description_id(world_id)
         if world_desc_id == 0:
             return results.TestResult(
                 False, 'Unable to determine world for Zone {}', zone_id)
         if world_desc_id is not None:
             data_object.add_objective_value(objective, world_id)
             self.on_increment_objective_data(event_data_tracker)
     count = data_object.get_objective_count(objective)
     if count < self.unique_worlds_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough matching world iterations.',
             current_value=count,
             goal_value=self.unique_worlds_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE
Example #15
0
 def increment_data(self, objective, resolver, event_data_tracker, result,
                    additional_result):
     data_object = event_data_tracker.data_object
     if result:
         if additional_result:
             tags_to_test = resolver.get_tags(objective.objective_test)
             for tag_from_test in tags_to_test:
                 for tag_from_objective in self.tag_checklist:
                     if tag_from_test is tag_from_objective:
                         data_object.add_objective_value(
                             objective, tag_from_objective)
                         self.on_increment_objective_data(
                             event_data_tracker)
                         break
     count = data_object.get_objective_count(objective)
     if count < self.unique_tags_required_to_pass:
         return results.TestResultNumeric(
             False,
             'Objective: not enough iterations.',
             current_value=count,
             goal_value=self.unique_tags_required_to_pass,
             is_money=False)
     return results.TestResult.TRUE