Exemplo n.º 1
0
 def construct_business_message(self, msg):
     msg.zone_id = self.business_zone_id
     persistence = services.get_persistence_service()
     zone_data = persistence.get_zone_proto_buff(self.business_zone_id)
     if zone_data is not None:
         msg.name = zone_data.name
     msg.is_open = self.is_open
     if self._open_time is not None:
         msg.time_opened = self._open_time.absolute_ticks()
     msg.daily_items_sold = self._daily_items_sold
     msg.daily_outgoing_costs = self.get_daily_outgoing_costs(include_employee_wages=False)
     msg.funds = self.funds.money
     msg.daily_customers_served = self._customer_manager.session_customers_served
     msg.net_profit = self.get_daily_net_profit(include_employee_wages=False)
     msg.markup_chosen = self.markup_multiplier
     msg.daily_revenue = int(self._daily_revenue)
     icon_tuning = self.tuning_data.business_icon
     msg.icon = ResourceKey_pb2.ResourceKey()
     msg.icon.instance = icon_tuning.instance
     msg.icon.group = icon_tuning.group
     msg.icon.type = icon_tuning.type
     msg.review_data = Business_pb2.ReviewDataUpdate()
     self._populate_review_update_message(msg.review_data)
     msg.minimum_employee_requirements_met = self.meets_minimum_employee_requirment()
Exemplo n.º 2
0
 def _send_review_update_message(self):
     review_msg = Business_pb2.ReviewDataUpdate()
     self._populate_review_update_message(review_msg)
     op = GenericProtocolBufferOp(DistributorOps_pb2.Operation.REVIEW_DATA_UPDATE, review_msg)
     Distributor.instance().add_op_with_no_owner(op)