Director director = new Director();
Builder builder;
If(msg.type == Object1)
builder= new ConcreteObject1(msg as StateObject1);
If(msg.type == Object2)
builder= new ConcreteObject2(msg as StateObject2);
director.Construct(builder);
Object object= builder.GetResult();
model.objects[msg.ID] = object;
sys.stderr = open('log.txt', 'w', 1)
.
P.S. Escape from Tarkov создана на Unity.