def __make__statement(self, useClasses): m = self.mMethod if (useClasses is not None): for c in useClasses: self.__push__statement(JOcMixHelper.callClass(c, m)) else: self.__push__statement(JOcMixHelper.makeStatement(m))
def _make_macros_simple(self, macros_name, left=1, right=16, indent=1): s = '' classes = self._rand_lnk_classes(left, right) for cls in classes: s += ST(indent) + JOcMixHelper.callClass(cls) + ' \\' + SN s += ST(indent) + 'NSLog(@"perform ' + macros_name + ' done");' + SN self.add_interface_macros(macros_name, s)
def _make_macros_catalogs(self, macros_name, indent=1): s = '' s += ST(indent) + 'dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{' + ' \\' + SN for cls in self._lnk_classes: s += ST(indent+1) + JOcMixHelper.callClass(cls) + ' \\' + SN s += ST(indent+1) + 'NSLog(@"perform ' + macros_name + ' done");' + ' \\' + SN s += ST(indent) + '});' + SN self.add_interface_macros(macros_name, s)
def _make_macros_resource(self, macros_name, indent=1): classes = self._rand_lnk_classes(2) pos = JRand.rand_int(0, len(classes)-2) s = '' for i in range(len(classes)): cls = classes[i] s += ST(indent) + JOcMixHelper.callClass(cls) + ' \\' + SN if i == pos: s += ST(indent) + self._cheater_cls.className + '::' + JCheatMaker.get_assets_func() + '();' + ' \\' + SN s += ST(indent) + 'NSLog(@"perform ' + macros_name + ' done");' + SN self.add_interface_macros(macros_name, s)
def _make_macros_disk_cheat(self, macros_name, indent=1): classes = self._rand_lnk_classes(2) pos = JRand.rand_int(0, len(classes) - 2) s = '' for i in range(len(classes)): cls = classes[i] s += ST(indent + 1) + JOcMixHelper.callClass(cls) + ' \\' + SN if i == pos: s += ST(indent) + 'dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{' + ' \\' + SN s += ST(indent+1) + self._cheater_cls.className + '::' + JCheatMaker.get_disk_i_func() + '();' + ' \\' + SN s += ST(indent+1) + self._cheater_cls.className + '::' + JCheatMaker.get_disk_o_func() + '();' + ' \\' + SN s += ST(indent) + '});' + ' \\' + SN s += ST(indent + 1) + 'NSLog(@"perform ' + macros_name + ' done");' + SN self.add_interface_macros(macros_name, s)
def useOtherClass(self, fromMeth): uses = self._include_classes if (uses is None): return None c = random.choice(uses) return JOcMixHelper.callClass(c, fromMeth)