def set_load_state_from_msg(self, effect_data): if effect_data is not None: effect_msg = GameplaySaveData_pb2.PersistableCivicPolicyStreetConditionalLayerEffectData( ) effect_msg.ParseFromString(effect_data) if effect_msg.start_tick == self.CHANGE_PENDING_SENTINEL_VALUE: self._change_pending = True self._last_change_start_time = DateAndTime(0) else: self._last_change_start_time = DateAndTime( effect_msg.start_tick)
def get_save_state_msg(self): if self._last_change_start_time is None: return effect_msg = GameplaySaveData_pb2.PersistableCivicPolicyStreetConditionalLayerEffectData( ) if self._change_pending: effect_msg.start_tick = self.CHANGE_PENDING_SENTINEL_VALUE else: effect_msg.start_tick = self._last_change_start_time.absolute_ticks( ) return effect_msg.SerializeToString()