Makes sense only for point entities
(SubgameEntity creator, List<String> args, GameExportsImpl gameExports)
| 1085 | * Makes sense only for point entities |
| 1086 | */ |
| 1087 | public static void createEntity(SubgameEntity creator, List<String> args, GameExportsImpl gameExports) { |
| 1088 | // hack: join back all the arguments, quoting keys and values |
| 1089 | // no comments are expected here |
| 1090 | String entities = args.stream() |
| 1091 | .skip(1) |
| 1092 | .filter(s -> !s.equals("}") && !s.equals("{")) |
| 1093 | .map(s -> '"' + s + '"') |
| 1094 | .collect(Collectors.joining(" ", "{", "}")); |
| 1095 | |
| 1096 | // actually we expect 1 entity |
| 1097 | EntityParserKt.parseEntities(entities).forEach(entity -> { |
| 1098 | SubgameEntity newThing = gameExports.G_Spawn(); |
| 1099 | entity.forEach((key, value) -> ED_ParseField(key, value, newThing, gameExports)); |
| 1100 | putInFrontOfCreator(creator, newThing); |
| 1101 | ED_CallSpawn(newThing, gameExports); |
| 1102 | }); |
| 1103 | } |
| 1104 | } |
no test coverage detected