Summary Files Commits Branches @commit @diff @stats
path: root / src / main.cpp
diff options
context:
space:
mode:
Commit11eb7853f38e8074268094c328737369a43dc3e4 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-07-23 13:55:05 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-07-23 13:55:05 +0300
Files4072eb13cf8f7c5711a365805cc3d981b4fa552f /src/main.cpp
screen-generator-nemetschek-11eb7853f38e8074268094c328737369a43dc3e4.tar
screen-generator-nemetschek-11eb7853f38e8074268094c328737369a43dc3e4.tar.gz
screen-generator-nemetschek-11eb7853f38e8074268094c328737369a43dc3e4.zip
Parent6244d8aa64d4d8ecf440b8cf6c0bcdd1ab2cd1d6 (diff)
feat: Implement entrypoint function
1 files changed, 32 insertions, 0 deletions
-rw-r--r--src/main.cpp32
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..704b439
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,32 @@
+#include <iostream>
+#include "cli.hpp"
+#include "Screen.h"
+#include "Television.h"
+#include "LEDVideoWall.h"
+
+enum class ScreenType {
+ TV = 0, LED
+};
+
+Screen* newScreen() {
+ unsigned int itype = 2;
+ cli::readUserInputMax(
+ itype,
+ (unsigned int)2,
+ "Select a screen type [0 for TV, 1 for LED]: ",
+ "Invalid type, try again!");
+
+ ScreenType type = static_cast<ScreenType>(itype);
+ switch (type) {
+ case ScreenType::TV: return Television::fromCommandLine();
+ case ScreenType::LED: return LEDVideoWall::fromCommandLine();
+ }
+ throw std::logic_error("Implementation error: not all ScreenType values are handled!");
+}
+
+int main() {
+ Screen* screen = newScreen();
+ std::cout << *screen << std::endl;
+ delete screen;
+ return 0;
+}