Skip to content
Snippets Groups Projects
Commit 315078b8 authored by Odilitime's avatar Odilitime
Browse files

i tag support, typeOfComponent() anime component support

parent c5dae42c
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,8 @@ const std::unordered_map<std::string, std::shared_ptr<Element>> ComponentBuilder
{"br", std::make_shared<DIVElement>()},
{"strong", std::make_shared<STRONGElement>()},
{"input", std::make_shared<INPUTElement>()},
{"b", std::make_shared<STRONGElement>()}
{"b", std::make_shared<STRONGElement>()},
{"i", std::make_shared<SPANElement>()}
};
std::shared_ptr<Component> ComponentBuilder::build(const std::shared_ptr<Node> node, const std::shared_ptr<Component> &parentComponent, int windowWidth, int windowHeight) {
......@@ -116,6 +117,7 @@ std::shared_ptr<Component> ComponentBuilder::build(const std::shared_ptr<Node> n
// these aren't used in any elements yet
#include "DocumentComponent.h"
#include "TabbedComponent.h"
#include "AnimeComponent.h"
std::string typeOfComponent(const std::shared_ptr<Component> &component) {
TabbedComponent *tabComponent = dynamic_cast<TabbedComponent*>(component.get());
......@@ -126,6 +128,8 @@ std::string typeOfComponent(const std::shared_ptr<Component> &component) {
if (textComponent) return "text";
InputComponent *inputComponent = dynamic_cast<InputComponent*>(component.get());
if (inputComponent) return "input";
AnimeComponent *animeComponent = dynamic_cast<AnimeComponent*>(component.get());
if (animeComponent) return "anime";
BoxComponent *boxComponent = dynamic_cast<BoxComponent*>(component.get());
if (boxComponent) return "box";
return "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment