BadScript 2
Loading...
Searching...
No Matches
BadDynamicInteropFunction.cs
Go to the documentation of this file.
5
10
15{
19 private readonly Func<BadExecutionContext, BadObject> m_Func;
20
28 Func<BadExecutionContext, BadObject> func,
29 BadClassPrototype returnType) : base(name,
30 false,
31 false,
32 returnType,
33 false
34 )
35 {
36 m_Func = func;
37 }
38
46 Action<BadExecutionContext> func,
47 BadClassPrototype returnType) : base(name,
48 false,
49 false,
50 returnType,
51 false
52 )
53 {
54 m_Func = context =>
55 {
56 func(context);
57
58 return Null;
59 };
60 }
61
70 Action func,
71 BadClassPrototype returnType,
72 params BadFunctionParameter[] parameters) : base(name,
73 false,
74 false,
75 returnType,
76 false,
77 parameters
78 )
79 {
80 m_Func = _ =>
81 {
82 func();
83
84 return Null;
85 };
86 }
87
89 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
90 {
91 CheckParameters(args, caller);
92
93 yield return m_Func(caller);
94 }
95
101 public static implicit operator BadDynamicInteropFunction(Func<BadExecutionContext, BadObject> func)
102 {
103 return new BadDynamicInteropFunction(null,
104 func,
106 );
107 }
108}
109
114public class BadDynamicInteropFunction<T> : BadFunction
115{
119 private readonly Func<BadExecutionContext, T, BadObject> m_Func;
120
129 Func<BadExecutionContext, T, BadObject> func,
130 BadClassPrototype returnType,
131 BadFunctionParameter param1) : base(name,
132 false,
133 false,
134 returnType,
135 false,
136 param1
137 )
138 {
139 m_Func = func;
140 }
141
143 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
144 {
145 CheckParameters(args, caller);
146
147 yield return m_Func.Invoke(caller,
148 GetParameter(args, 0)
149 .Unwrap<T>()
150 );
151 }
152
158 public static implicit operator BadDynamicInteropFunction<T>(Func<BadExecutionContext, T, BadObject> func)
159 {
160 return new BadDynamicInteropFunction<T>(null,
161 func,
163 typeof(T).Name
164 );
165 }
166}
167
173public class BadDynamicInteropFunction<T1, T2> : BadFunction
174{
178 private readonly Func<BadExecutionContext, T1, T2, BadObject> m_Func;
179
189 Func<BadExecutionContext, T1, T2, BadObject> func,
190 BadClassPrototype returnType,
192 BadFunctionParameter param2) : base(name,
193 false,
194 false,
195 returnType,
196 false,
197 param1, param2
198 )
199 {
200 m_Func = func;
201 }
202
204 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
205 {
206 CheckParameters(args, caller);
207
208 yield return m_Func.Invoke(caller,
209 GetParameter(args, 0)
210 .Unwrap<T1>(),
211 GetParameter(args, 1)
212 .Unwrap<T2>()
213 );
214 }
215
221 public static implicit operator BadDynamicInteropFunction<T1, T2>(Func<BadExecutionContext, T1, T2, BadObject> func)
222 {
223 return new BadDynamicInteropFunction<T1, T2>(null,
224 func,
226 typeof(T1).Name,
227 typeof(T2).Name
228 );
229 }
230}
231
238public class BadDynamicInteropFunction<T1, T2, T3> : BadFunction
239{
243 private readonly Func<BadExecutionContext, T1, T2, T3, BadObject> m_Func;
244
255 Func<BadExecutionContext, T1, T2, T3, BadObject> func,
256 BadClassPrototype returnType,
259 BadFunctionParameter param3) : base(name,
260 false,
261 false,
262 returnType,
263 false,
264 param1, param2, param3
265 )
266 {
267 m_Func = func;
268 }
269
271 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
272 {
273 CheckParameters(args, caller);
274
275 yield return m_Func.Invoke(caller,
276 GetParameter(args, 0)
277 .Unwrap<T1>(),
278 GetParameter(args, 1)
279 .Unwrap<T2>(),
280 GetParameter(args, 2)
281 .Unwrap<T3>()
282 );
283 }
284
290 public static implicit operator BadDynamicInteropFunction<T1, T2, T3>(
291 Func<BadExecutionContext, T1, T2, T3, BadObject> func)
292 {
294 func,
296 typeof(T1).Name,
297 typeof(T2).Name,
298 typeof(T3).Name
299 );
300 }
301}
302
310public class BadDynamicInteropFunction<T1, T2, T3, T4> : BadFunction
311{
315 private readonly Func<BadExecutionContext, T1, T2, T3, T4, BadObject> m_Func;
316
328 Func<BadExecutionContext, T1, T2, T3, T4, BadObject> func,
329 BadClassPrototype returnType,
333 BadFunctionParameter param4) : base(name,
334 false,
335 false,
336 returnType,
337 false,
338 param1, param2, param3, param4
339 )
340 {
341 m_Func = func;
342 }
343
345 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
346 {
347 CheckParameters(args, caller);
348
349 yield return m_Func.Invoke(caller,
350 GetParameter(args, 0)
351 .Unwrap<T1>(),
352 GetParameter(args, 1)
353 .Unwrap<T2>(),
354 GetParameter(args, 2)
355 .Unwrap<T3>(),
356 GetParameter(args, 3)
357 .Unwrap<T4>()
358 );
359 }
360
366 public static implicit operator BadDynamicInteropFunction<T1, T2, T3, T4>(
367 Func<BadExecutionContext, T1, T2, T3, T4, BadObject> func)
368 {
370 func,
372 typeof(T1).Name,
373 typeof(T2).Name,
374 typeof(T3).Name,
375 typeof(T4).Name
376 );
377 }
378}
379
388public class BadDynamicInteropFunction<T1, T2, T3, T4, T5> : BadFunction
389{
393 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, BadObject> m_Func;
394
407 Func<BadExecutionContext, T1, T2, T3, T4, T5, BadObject> func,
408 BadClassPrototype returnType,
413 BadFunctionParameter param5) : base(name,
414 false,
415 false,
416 returnType,
417 false,
418 param1, param2, param3, param4, param5
419 )
420 {
421 m_Func = func;
422 }
423
425 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
426 {
427 CheckParameters(args, caller);
428
429 yield return m_Func.Invoke(caller,
430 GetParameter(args, 0)
431 .Unwrap<T1>(),
432 GetParameter(args, 1)
433 .Unwrap<T2>(),
434 GetParameter(args, 2)
435 .Unwrap<T3>(),
436 GetParameter(args, 3)
437 .Unwrap<T4>(),
438 GetParameter(args, 4)
439 .Unwrap<T5>()
440 );
441 }
442
448 public static implicit operator BadDynamicInteropFunction<T1, T2, T3, T4, T5>(
449 Func<BadExecutionContext, T1, T2, T3, T4, T5, BadObject> func)
450 {
452 func,
454 typeof(T1).Name,
455 typeof(T2).Name,
456 typeof(T3).Name,
457 typeof(T4).Name,
458 typeof(T5).Name
459 );
460 }
461}
462
472public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6> : BadFunction
473{
477 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject> m_Func;
478
492 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject> func,
493 BadClassPrototype returnType,
499 BadFunctionParameter param6) : base(name,
500 false,
501 false,
502 returnType,
503 false,
504 param1, param2, param3, param4, param5, param6
505 )
506 {
507 m_Func = func;
508 }
509
511 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
512 {
513 CheckParameters(args, caller);
514
515 yield return m_Func.Invoke(caller,
516 GetParameter(args, 0)
517 .Unwrap<T1>(),
518 GetParameter(args, 1)
519 .Unwrap<T2>(),
520 GetParameter(args, 2)
521 .Unwrap<T3>(),
522 GetParameter(args, 3)
523 .Unwrap<T4>(),
524 GetParameter(args, 4)
525 .Unwrap<T5>(),
526 GetParameter(args, 5)
527 .Unwrap<T6>()
528 );
529 }
530
537 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject> func)
538 {
540 func,
542 typeof(T1).Name,
543 typeof(T2).Name,
544 typeof(T3).Name,
545 typeof(T4).Name,
546 typeof(T5).Name,
547 typeof(T6).Name
548 );
549 }
550}
551
562public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7> : BadFunction
563{
567 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, BadObject> m_Func;
568
583 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, BadObject> func,
584 BadClassPrototype returnType,
591 BadFunctionParameter param7) : base(name,
592 false,
593 false,
594 returnType,
595 false,
596 param1, param2, param3, param4, param5, param6, param7
597 )
598 {
599 m_Func = func;
600 }
601
603 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
604 {
605 CheckParameters(args, caller);
606
607 yield return m_Func.Invoke(caller,
608 GetParameter(args, 0)
609 .Unwrap<T1>(),
610 GetParameter(args, 1)
611 .Unwrap<T2>(),
612 GetParameter(args, 2)
613 .Unwrap<T3>(),
614 GetParameter(args, 3)
615 .Unwrap<T4>(),
616 GetParameter(args, 4)
617 .Unwrap<T5>(),
618 GetParameter(args, 5)
619 .Unwrap<T6>(),
620 GetParameter(args, 6)
621 .Unwrap<T7>()
622 );
623 }
624
631 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, BadObject> func)
632 {
634 func,
636 typeof(T1).Name,
637 typeof(T2).Name,
638 typeof(T3).Name,
639 typeof(T4).Name,
640 typeof(T5).Name,
641 typeof(T6).Name,
642 typeof(T7).Name
643 );
644 }
645}
646
658public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8> : BadFunction
659{
663 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, BadObject> m_Func;
664
680 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, BadObject> func,
681 BadClassPrototype returnType,
689 BadFunctionParameter param8) : base(name,
690 false,
691 false,
692 returnType,
693 false,
694 param1, param2, param3, param4, param5, param6, param7, param8
695 )
696 {
697 m_Func = func;
698 }
699
701 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
702 {
703 CheckParameters(args, caller);
704
705 yield return m_Func.Invoke(caller,
706 GetParameter(args, 0)
707 .Unwrap<T1>(),
708 GetParameter(args, 1)
709 .Unwrap<T2>(),
710 GetParameter(args, 2)
711 .Unwrap<T3>(),
712 GetParameter(args, 3)
713 .Unwrap<T4>(),
714 GetParameter(args, 4)
715 .Unwrap<T5>(),
716 GetParameter(args, 5)
717 .Unwrap<T6>(),
718 GetParameter(args, 6)
719 .Unwrap<T7>(),
720 GetParameter(args, 7)
721 .Unwrap<T8>()
722 );
723 }
724
731 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, BadObject> func)
732 {
734 func,
736 typeof(T1).Name,
737 typeof(T2).Name,
738 typeof(T3).Name,
739 typeof(T4).Name,
740 typeof(T5).Name,
741 typeof(T6).Name,
742 typeof(T7).Name,
743 typeof(T8).Name
744 );
745 }
746}
747
760public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9> : BadFunction
761{
765 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, BadObject> m_Func;
766
783 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, BadObject> func,
784 BadClassPrototype returnType,
793 BadFunctionParameter param9) : base(name,
794 false,
795 false,
796 returnType,
797 false,
798 param1, param2, param3, param4, param5, param6, param7, param8, param9
799 )
800 {
801 m_Func = func;
802 }
803
805 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
806 {
807 CheckParameters(args, caller);
808
809 yield return m_Func.Invoke(caller,
810 GetParameter(args, 0)
811 .Unwrap<T1>(),
812 GetParameter(args, 1)
813 .Unwrap<T2>(),
814 GetParameter(args, 2)
815 .Unwrap<T3>(),
816 GetParameter(args, 3)
817 .Unwrap<T4>(),
818 GetParameter(args, 4)
819 .Unwrap<T5>(),
820 GetParameter(args, 5)
821 .Unwrap<T6>(),
822 GetParameter(args, 6)
823 .Unwrap<T7>(),
824 GetParameter(args, 7)
825 .Unwrap<T8>(),
826 GetParameter(args, 8)
827 .Unwrap<T9>()
828 );
829 }
830
837 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, BadObject> func)
838 {
840 func,
842 typeof(T1).Name,
843 typeof(T2).Name,
844 typeof(T3).Name,
845 typeof(T4).Name,
846 typeof(T5).Name,
847 typeof(T6).Name,
848 typeof(T7).Name,
849 typeof(T8).Name,
850 typeof(T9).Name
851 );
852 }
853}
854
868public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> : BadFunction
869{
873 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BadObject> m_Func;
874
892 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BadObject> func,
893 BadClassPrototype returnType,
903 BadFunctionParameter param10) : base(name,
904 false,
905 false,
906 returnType,
907 false,
908 param1, param2, param3, param4, param5, param6, param7, param8, param9, param10
909 )
910 {
911 m_Func = func;
912 }
913
915 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
916 {
917 CheckParameters(args, caller);
918
919 yield return m_Func.Invoke(caller,
920 GetParameter(args, 0)
921 .Unwrap<T1>(),
922 GetParameter(args, 1)
923 .Unwrap<T2>(),
924 GetParameter(args, 2)
925 .Unwrap<T3>(),
926 GetParameter(args, 3)
927 .Unwrap<T4>(),
928 GetParameter(args, 4)
929 .Unwrap<T5>(),
930 GetParameter(args, 5)
931 .Unwrap<T6>(),
932 GetParameter(args, 6)
933 .Unwrap<T7>(),
934 GetParameter(args, 7)
935 .Unwrap<T8>(),
936 GetParameter(args, 8)
937 .Unwrap<T9>(),
938 GetParameter(args, 9)
939 .Unwrap<T10>()
940 );
941 }
942
949 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BadObject> func)
950 {
952 func,
954 typeof(T1).Name,
955 typeof(T2).Name,
956 typeof(T3).Name,
957 typeof(T4).Name,
958 typeof(T5).Name,
959 typeof(T6).Name,
960 typeof(T7).Name,
961 typeof(T8).Name,
962 typeof(T9).Name,
963 typeof(T10).Name
964 );
965 }
966}
967
982public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> : BadFunction
983{
987 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject> m_Func;
988
1007 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject>
1008 func,
1009 BadClassPrototype returnType,
1010 BadFunctionParameter param1,
1011 BadFunctionParameter param2,
1012 BadFunctionParameter param3,
1013 BadFunctionParameter param4,
1014 BadFunctionParameter param5,
1015 BadFunctionParameter param6,
1016 BadFunctionParameter param7,
1017 BadFunctionParameter param8,
1018 BadFunctionParameter param9,
1019 BadFunctionParameter param10,
1020 BadFunctionParameter param11) : base(name,
1021 false,
1022 false,
1023 returnType,
1024 false,
1025 param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11
1026 )
1027 {
1028 m_Func = func;
1029 }
1030
1032 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
1033 {
1034 CheckParameters(args, caller);
1035
1036 yield return m_Func.Invoke(caller,
1037 GetParameter(args, 0)
1038 .Unwrap<T1>(),
1039 GetParameter(args, 1)
1040 .Unwrap<T2>(),
1041 GetParameter(args, 2)
1042 .Unwrap<T3>(),
1043 GetParameter(args, 3)
1044 .Unwrap<T4>(),
1045 GetParameter(args, 4)
1046 .Unwrap<T5>(),
1047 GetParameter(args, 5)
1048 .Unwrap<T6>(),
1049 GetParameter(args, 6)
1050 .Unwrap<T7>(),
1051 GetParameter(args, 7)
1052 .Unwrap<T8>(),
1053 GetParameter(args, 8)
1054 .Unwrap<T9>(),
1055 GetParameter(args, 9)
1056 .Unwrap<T10>(),
1057 GetParameter(args, 10)
1058 .Unwrap<T11>()
1059 );
1060 }
1061
1068 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject> func)
1069 {
1071 func,
1073 typeof(T1).Name,
1074 typeof(T2).Name,
1075 typeof(T3).Name,
1076 typeof(T4).Name,
1077 typeof(T5).Name,
1078 typeof(T6).Name,
1079 typeof(T7).Name,
1080 typeof(T8).Name,
1081 typeof(T9).Name,
1082 typeof(T10).Name,
1083 typeof(T11).Name
1084 );
1085 }
1086}
1087
1103public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> : BadFunction
1104{
1108 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BadObject> m_Func;
1109
1129 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12,
1130 BadObject> func,
1131 BadClassPrototype returnType,
1132 BadFunctionParameter param1,
1133 BadFunctionParameter param2,
1134 BadFunctionParameter param3,
1135 BadFunctionParameter param4,
1136 BadFunctionParameter param5,
1137 BadFunctionParameter param6,
1138 BadFunctionParameter param7,
1139 BadFunctionParameter param8,
1140 BadFunctionParameter param9,
1141 BadFunctionParameter param10,
1142 BadFunctionParameter param11,
1143 BadFunctionParameter param12) : base(name,
1144 false,
1145 false,
1146 returnType,
1147 false,
1148 param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12
1149 )
1150 {
1151 m_Func = func;
1152 }
1153
1155 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
1156 {
1157 CheckParameters(args, caller);
1158
1159 yield return m_Func.Invoke(caller,
1160 GetParameter(args, 0)
1161 .Unwrap<T1>(),
1162 GetParameter(args, 1)
1163 .Unwrap<T2>(),
1164 GetParameter(args, 2)
1165 .Unwrap<T3>(),
1166 GetParameter(args, 3)
1167 .Unwrap<T4>(),
1168 GetParameter(args, 4)
1169 .Unwrap<T5>(),
1170 GetParameter(args, 5)
1171 .Unwrap<T6>(),
1172 GetParameter(args, 6)
1173 .Unwrap<T7>(),
1174 GetParameter(args, 7)
1175 .Unwrap<T8>(),
1176 GetParameter(args, 8)
1177 .Unwrap<T9>(),
1178 GetParameter(args, 9)
1179 .Unwrap<T10>(),
1180 GetParameter(args, 10)
1181 .Unwrap<T11>(),
1182 GetParameter(args, 11)
1183 .Unwrap<T12>()
1184 );
1185 }
1186
1193 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BadObject> func)
1194 {
1196 func,
1198 typeof(T1).Name,
1199 typeof(T2).Name,
1200 typeof(T3).Name,
1201 typeof(T4).Name,
1202 typeof(T5).Name,
1203 typeof(T6).Name,
1204 typeof(T7).Name,
1205 typeof(T8).Name,
1206 typeof(T9).Name,
1207 typeof(T10).Name,
1208 typeof(T11).Name,
1209 typeof(T12).Name
1210 );
1211 }
1212}
1213
1230public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> : BadFunction
1231{
1235 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BadObject>
1237
1258 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1259 BadObject> func,
1260 BadClassPrototype returnType,
1261 BadFunctionParameter param1,
1262 BadFunctionParameter param2,
1263 BadFunctionParameter param3,
1264 BadFunctionParameter param4,
1265 BadFunctionParameter param5,
1266 BadFunctionParameter param6,
1267 BadFunctionParameter param7,
1268 BadFunctionParameter param8,
1269 BadFunctionParameter param9,
1270 BadFunctionParameter param10,
1271 BadFunctionParameter param11,
1272 BadFunctionParameter param12,
1273 BadFunctionParameter param13) : base(name,
1274 false,
1275 false,
1276 returnType,
1277 false,
1278 param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13
1279 )
1280 {
1281 m_Func = func;
1282 }
1283
1285 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
1286 {
1287 CheckParameters(args, caller);
1288
1289 yield return m_Func.Invoke(caller,
1290 GetParameter(args, 0)
1291 .Unwrap<T1>(),
1292 GetParameter(args, 1)
1293 .Unwrap<T2>(),
1294 GetParameter(args, 2)
1295 .Unwrap<T3>(),
1296 GetParameter(args, 3)
1297 .Unwrap<T4>(),
1298 GetParameter(args, 4)
1299 .Unwrap<T5>(),
1300 GetParameter(args, 5)
1301 .Unwrap<T6>(),
1302 GetParameter(args, 6)
1303 .Unwrap<T7>(),
1304 GetParameter(args, 7)
1305 .Unwrap<T8>(),
1306 GetParameter(args, 8)
1307 .Unwrap<T9>(),
1308 GetParameter(args, 9)
1309 .Unwrap<T10>(),
1310 GetParameter(args, 10)
1311 .Unwrap<T11>(),
1312 GetParameter(args, 11)
1313 .Unwrap<T12>(),
1314 GetParameter(args, 12)
1315 .Unwrap<T13>()
1316 );
1317 }
1318
1325 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BadObject> func)
1326 {
1328 func,
1330 typeof(T1).Name,
1331 typeof(T2).Name,
1332 typeof(T3).Name,
1333 typeof(T4).Name,
1334 typeof(T5).Name,
1335 typeof(T6).Name,
1336 typeof(T7).Name,
1337 typeof(T8).Name,
1338 typeof(T9).Name,
1339 typeof(T10).Name,
1340 typeof(T11).Name,
1341 typeof(T12).Name,
1342 typeof(T13).Name
1343 );
1344 }
1345}
1346
1364public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> : BadFunction
1365{
1369 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BadObject>
1371
1393 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1394 T14, BadObject> func,
1395 BadClassPrototype returnType,
1396 BadFunctionParameter param1,
1397 BadFunctionParameter param2,
1398 BadFunctionParameter param3,
1399 BadFunctionParameter param4,
1400 BadFunctionParameter param5,
1401 BadFunctionParameter param6,
1402 BadFunctionParameter param7,
1403 BadFunctionParameter param8,
1404 BadFunctionParameter param9,
1405 BadFunctionParameter param10,
1406 BadFunctionParameter param11,
1407 BadFunctionParameter param12,
1408 BadFunctionParameter param13,
1409 BadFunctionParameter param14) : base(name,
1410 false,
1411 false,
1412 returnType,
1413 false,
1414 param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14
1415 )
1416 {
1417 m_Func = func;
1418 }
1419
1421 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
1422 {
1423 CheckParameters(args, caller);
1424
1425 yield return m_Func.Invoke(caller,
1426 GetParameter(args, 0)
1427 .Unwrap<T1>(),
1428 GetParameter(args, 1)
1429 .Unwrap<T2>(),
1430 GetParameter(args, 2)
1431 .Unwrap<T3>(),
1432 GetParameter(args, 3)
1433 .Unwrap<T4>(),
1434 GetParameter(args, 4)
1435 .Unwrap<T5>(),
1436 GetParameter(args, 5)
1437 .Unwrap<T6>(),
1438 GetParameter(args, 6)
1439 .Unwrap<T7>(),
1440 GetParameter(args, 7)
1441 .Unwrap<T8>(),
1442 GetParameter(args, 8)
1443 .Unwrap<T9>(),
1444 GetParameter(args, 9)
1445 .Unwrap<T10>(),
1446 GetParameter(args, 10)
1447 .Unwrap<T11>(),
1448 GetParameter(args, 11)
1449 .Unwrap<T12>(),
1450 GetParameter(args, 12)
1451 .Unwrap<T13>(),
1452 GetParameter(args, 13)
1453 .Unwrap<T14>()
1454 );
1455 }
1456
1462 public static implicit operator
1464 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BadObject> func)
1465 {
1467 func,
1469 typeof(T1).Name,
1470 typeof(T2).Name,
1471 typeof(T3).Name,
1472 typeof(T4).Name,
1473 typeof(T5).Name,
1474 typeof(T6).Name,
1475 typeof(T7).Name,
1476 typeof(T8).Name,
1477 typeof(T9).Name,
1478 typeof(T10).Name,
1479 typeof(T11).Name,
1480 typeof(T12).Name,
1481 typeof(T13).Name,
1482 typeof(T14).Name
1483 );
1484 }
1485}
1486
1505public class BadDynamicInteropFunction<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> : BadFunction
1506{
1510 private readonly Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15,
1512
1535 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13,
1536 T14, T15, BadObject> func,
1537 BadClassPrototype returnType,
1538 BadFunctionParameter param1,
1539 BadFunctionParameter param2,
1540 BadFunctionParameter param3,
1541 BadFunctionParameter param4,
1542 BadFunctionParameter param5,
1543 BadFunctionParameter param6,
1544 BadFunctionParameter param7,
1545 BadFunctionParameter param8,
1546 BadFunctionParameter param9,
1547 BadFunctionParameter param10,
1548 BadFunctionParameter param11,
1549 BadFunctionParameter param12,
1550 BadFunctionParameter param13,
1551 BadFunctionParameter param14,
1552 BadFunctionParameter param15) : base(name,
1553 false,
1554 false,
1555 returnType,
1556 false,
1557 param1, param2, param3, param4, param5, param6, param7, param8, param9, param10, param11, param12, param13, param14, param15
1558 )
1559 {
1560 m_Func = func;
1561 }
1562
1564 protected override IEnumerable<BadObject> InvokeBlock(BadObject[] args, BadExecutionContext caller)
1565 {
1566 CheckParameters(args, caller);
1567
1568 yield return m_Func.Invoke(caller,
1569 GetParameter(args, 0)
1570 .Unwrap<T1>(),
1571 GetParameter(args, 1)
1572 .Unwrap<T2>(),
1573 GetParameter(args, 2)
1574 .Unwrap<T3>(),
1575 GetParameter(args, 3)
1576 .Unwrap<T4>(),
1577 GetParameter(args, 4)
1578 .Unwrap<T5>(),
1579 GetParameter(args, 5)
1580 .Unwrap<T6>(),
1581 GetParameter(args, 6)
1582 .Unwrap<T7>(),
1583 GetParameter(args, 7)
1584 .Unwrap<T8>(),
1585 GetParameter(args, 8)
1586 .Unwrap<T9>(),
1587 GetParameter(args, 9)
1588 .Unwrap<T10>(),
1589 GetParameter(args, 10)
1590 .Unwrap<T11>(),
1591 GetParameter(args, 11)
1592 .Unwrap<T12>(),
1593 GetParameter(args, 12)
1594 .Unwrap<T13>(),
1595 GetParameter(args, 13)
1596 .Unwrap<T14>(),
1597 GetParameter(args, 14)
1598 .Unwrap<T15>()
1599 );
1600 }
1601
1607 public static implicit operator
1609 Func<BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BadObject> func)
1610 {
1612 func,
1614 typeof(T1).Name,
1615 typeof(T2).Name,
1616 typeof(T3).Name,
1617 typeof(T4).Name,
1618 typeof(T5).Name,
1619 typeof(T6).Name,
1620 typeof(T7).Name,
1621 typeof(T8).Name,
1622 typeof(T9).Name,
1623 typeof(T10).Name,
1624 typeof(T11).Name,
1625 typeof(T12).Name,
1626 typeof(T13).Name,
1627 typeof(T14).Name,
1628 typeof(T15).Name
1629 );
1630 }
1631}
The Execution Context. Every execution of a script needs a context the script is running in....
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, BadObject > func, BadClassPrototype returnType)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Action< BadExecutionContext > func, BadClassPrototype returnType)
Creates a new BadDynamicInteropFunction.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BadObject > m_Func
The Function Lambda.
readonly Func< BadExecutionContext, T, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7)
Creates a new BadDynamicInteropFunction.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9, BadFunctionParameter param10, BadFunctionParameter param11, BadFunctionParameter param12, BadFunctionParameter param13, BadFunctionParameter param14)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9, BadFunctionParameter param10, BadFunctionParameter param11, BadFunctionParameter param12, BadFunctionParameter param13, BadFunctionParameter param14, BadFunctionParameter param15)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, BadObject > m_Func
The Function Lambda.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BadObject > m_Func
The Function Lambda.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2)
Creates a new BadDynamicInteropFunction.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, BadObject > m_Func
The Function Lambda.
readonly Func< BadExecutionContext, T1, T2, T3, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1)
Creates a new BadDynamicInteropFunction.
override IEnumerable< BadObject > InvokeBlock(BadObject[] args, BadExecutionContext caller)
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Action func, BadClassPrototype returnType, params BadFunctionParameter[] parameters)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BadObject > m_Func
The Function Lambda.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9, BadFunctionParameter param10, BadFunctionParameter param11, BadFunctionParameter param12)
Creates a new BadDynamicInteropFunction.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9, BadFunctionParameter param10, BadFunctionParameter param11)
Creates a new BadDynamicInteropFunction.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9, BadFunctionParameter param10)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4, BadFunctionParameter param5, BadFunctionParameter param6, BadFunctionParameter param7, BadFunctionParameter param8, BadFunctionParameter param9, BadFunctionParameter param10, BadFunctionParameter param11, BadFunctionParameter param12, BadFunctionParameter param13)
Creates a new BadDynamicInteropFunction.
readonly Func< BadExecutionContext, T1, T2, BadObject > m_Func
The Function Lambda.
BadDynamicInteropFunction(BadWordToken? name, Func< BadExecutionContext, T1, T2, T3, T4, BadObject > func, BadClassPrototype returnType, BadFunctionParameter param1, BadFunctionParameter param2, BadFunctionParameter param3, BadFunctionParameter param4)
Creates a new BadDynamicInteropFunction.
The Base Class for all BadScript Objects.
Definition BadObject.cs:14
static readonly BadObject Null
The Null Value for the BadScript Language.
Definition BadObject.cs:28
Implements a function that can be called from the script.
BadWordToken? Name
(optional) Name of the Function
static BadObject GetParameter(BadObject[] args, int i)
Returns the Function Parameter at the given index.
void CheckParameters(BadObject[] args, BadExecutionContext caller, BadSourcePosition? position=null)
Checks Parameters for the given function call.
The Any Prototype, Base type for all types.
static readonly BadAnyPrototype Instance
The Instance of the BadAnyPrototype.
Implements a Class Prototype for the BadScript Language.
Contains the Reader Tokens for the BadScript2 Language.
Contains the Interop Function Classes for the BadScript2 Language.
Contains Runtime Function Objects.
Contains the Runtime Objects.
Definition BadArray.cs:10