feat: parser implementation and structure refactor#11
Conversation
| std::cout << " [SceneObject] Utworzono obiekt: " << name << "\n"; | ||
| } | ||
|
|
||
| void setTransform(double posX, double posY, double width, double height, double rotation) { |
There was a problem hiding this comment.
This seems like it should be abstracted in the future, into either just math vectors or a custom better suited Transform type.
For scaffolding its good enough though i think
I would just make the user pass in the transform struct instead of this in-place construction
| double blink_frequency_hz = 1; | ||
| } | ||
|
|
||
| message ScriptComponent { |
There was a problem hiding this comment.
additional dictionary or something for script parameters? Or are we just expecting each Script passed to be void -> void ?
| return obj; | ||
| } | ||
|
|
||
| std::unique_ptr<Component> Parser::buildComponent(const NeuronIDE::Component& protoComp) { |
There was a problem hiding this comment.
Delegate this to the components themselves?
Adding a case here for each component seems wrong when we can just do inheritence.
There was a problem hiding this comment.
I'm not sure if we can "just do inheritence" here, we could however use map instead of switch case, maybe we could store that map in some seperate ComponentRegistry class.
| blinker { | ||
| blink_frequency_hz: 3 | ||
| } | ||
| } |
There was a problem hiding this comment.
I think we should also validate the .pb files, because no object should ever have 2 components of the same type, we should throw some error.
No description provided.