diff --git a/include/CharacterView.h b/include/CharacterView.h new file mode 100644 index 0000000..ed526d5 --- /dev/null +++ b/include/CharacterView.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +class CharacterView : public QWidget +{ + public: + CharacterView(); +}; diff --git a/include/character.h b/include/character.h new file mode 100644 index 0000000..15f11cc --- /dev/null +++ b/include/character.h @@ -0,0 +1,7 @@ +#pragma once + +class Character +{ + public: + Character(); +}; diff --git a/include/characterproperty.h b/include/characterproperty.h new file mode 100644 index 0000000..bf87eb2 --- /dev/null +++ b/include/characterproperty.h @@ -0,0 +1,33 @@ +#pragma once + +#include +#include + +class CharacterProperty +{ + public: + using StringType = std::string; + using IntegerType = int; + using FloatingType = double; + + public: + enum Type { + string, + integer, + floating_point + }; + + public: + CharacterProperty(); + + std::optional toString() const; + std::optional toInt() const; + std::optional toFloat() const; + + private: + Type m_valueType; + + StringType m_valueString; + IntegerType m_valueInt; + FloatingType m_valueFloat; +}; diff --git a/include/characterview.h b/include/characterview.h new file mode 100644 index 0000000..ed526d5 --- /dev/null +++ b/include/characterview.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +class CharacterView : public QWidget +{ + public: + CharacterView(); +}; diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5570d00..be83a29 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,6 +2,13 @@ include_directories(${jdr-desktop_SOURCE_DIR}) include_directories(${jdr-desktop_SOURCE_DIR}/include) add_executable(jdr-desktop + #models + characterproperty.cpp + character.cpp + + #views + characterview.cpp + main.cpp ) diff --git a/src/character.cpp b/src/character.cpp new file mode 100644 index 0000000..0a0455f --- /dev/null +++ b/src/character.cpp @@ -0,0 +1,6 @@ +#include "character.h" + +Character::Character() +{ + +} diff --git a/src/characterproperty.cpp b/src/characterproperty.cpp new file mode 100644 index 0000000..25d581e --- /dev/null +++ b/src/characterproperty.cpp @@ -0,0 +1,29 @@ +#include "characterproperty.h" + +CharacterProperty::CharacterProperty() +{ +} + +std::optional CharacterProperty::toString() const +{ + if(m_valueType != Type::string) + return std::nullopt; + + return std::make_optional(m_valueString); +} + +std::optional CharacterProperty::toInt() const +{ + if(m_valueType != Type::integer) + return std::nullopt; + + return std::make_optional(m_valueInt); +} + +std::optional CharacterProperty::toFloat() const +{ + if(m_valueType != Type::floating_point) + return std::nullopt; + + return std::make_optional(m_valueFloat); +} diff --git a/src/characterview.cpp b/src/characterview.cpp new file mode 100644 index 0000000..dd9f518 --- /dev/null +++ b/src/characterview.cpp @@ -0,0 +1,5 @@ +#include "characterview.h" + +CharacterView::CharacterView() +{ +} diff --git a/src/main.cpp b/src/main.cpp index 09841ee..053338f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,9 +1,13 @@ #include #include +#include "characterview.h" int main(int argc, char** argv) { QApplication app(argc, argv); + CharacterView window; + window.show(); + return app.exec(); }