Services codegen is now a part of standard codegen
Publish PHP Package / docker (push) Successful in 7s
Details
Publish PHP Package / docker (push) Successful in 7s
Details
This commit is contained in:
parent
61ced3a581
commit
f4f4d3bf27
|
@ -59,6 +59,8 @@ function codegen(?string $cache_dir, \mtgMetaInfo $meta, array $options = []) :
|
|||
|
||||
$output['factory.cs'] = $twig->render('codegen_factory.twig', $options);
|
||||
|
||||
$output['services.cs'] = codegen_services($cache_dir, filter_services_meta($meta), $options);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
|
@ -19,10 +19,8 @@ static public class AutogenBundle
|
|||
{
|
||||
switch(class_id)
|
||||
{
|
||||
{%- for u in meta.getunits ~%}
|
||||
{%- if u.object is instanceof('\\mtgMetaStruct')~%}
|
||||
case {{u.object.classid}}: { return new {{u.object.name}}(); }
|
||||
{%- endif ~%}
|
||||
{%- for t in meta.factorytypes ~%}
|
||||
case {{t.classid}}: { return new {{t.fullname}}(); }
|
||||
{%- endfor ~%}
|
||||
default:
|
||||
{
|
||||
|
|
|
@ -21,21 +21,6 @@ public interface IRpc : metagen.IRpc
|
|||
|
||||
public static class Factory
|
||||
{
|
||||
public static IMetaStruct CreateById(uint class_id)
|
||||
{
|
||||
switch(class_id)
|
||||
{
|
||||
{%- for utype in obj.usertypes %}
|
||||
{%- if utype is instanceof('\\mtgMetaStruct') ~%}
|
||||
case {{utype.classid}}:
|
||||
return new {{utype.name}}();
|
||||
{% endif %}
|
||||
{%- endfor ~%}
|
||||
}
|
||||
//fallback to global factory
|
||||
return AutogenBundle.createById(class_id);
|
||||
}
|
||||
|
||||
public static IRpc CreateRPC(int code)
|
||||
{
|
||||
switch(code)
|
||||
|
|
Loading…
Reference in New Issue