diff --git a/source/ResultWidget/AkkusativPR.h b/source/ResultWidget/AkkusativPR.h new file mode 100644 index 0000000..8e43687 --- /dev/null +++ b/source/ResultWidget/AkkusativPR.h @@ -0,0 +1,49 @@ +#pragma once + +#include "PRMap.h" + +class AkkusativPR : public PRMap +{ +public: + AkkusativPR() + { + // clang-format off + m_ages = { + { 4, 0 }, + { 5, 0 }, + { 6, 0 }, + { 7, 0 }, + { 8, 0 }, + { 9, 0 } + }; + + m_PRs = { + { 1, 0, 0, 1, 0 }, + { 1, 0, 0, 1, 0 }, + { 1, 0, 0, 1, 0 }, + { 1, 0, 0, 1, 0 }, + { 1, 0, 0, 1, 0 }, + { 1, 1, 0, 1, 0 }, + { 1, 1, 1, 1, 0 }, + { 1, 1, 1, 2, 0 }, + { 2, 1, 1, 2, 0 }, + { 4, 3, 1, 2, 0 }, + { 6, 3, 2, 2, 0 }, + { 7, 4, 2, 2, 0 }, + { 10, 4, 2, 2, 1 }, + { 12, 6, 3, 3, 1 }, + { 17, 8, 5, 4, 2 }, + { 26, 12, 7, 6, 4 }, + { 32, 19, 11, 9, 6 }, + { 38, 25, 18, 14, 9 }, + { 44, 34, 25, 17, 12 }, + { 56, 43, 31, 24, 17 }, + { 64, 50, 42, 32, 28 }, + { 76, 61, 49, 40, 36 }, + { 86, 75, 63, 54, 45 }, + { 95, 89, 76, 74, 69 }, + { 100, 100, 100, 100, 100 } + }; + // clang-format on + } +}; diff --git a/source/ResultWidget/DativPR.h b/source/ResultWidget/DativPR.h new file mode 100644 index 0000000..2d60170 --- /dev/null +++ b/source/ResultWidget/DativPR.h @@ -0,0 +1,49 @@ +#pragma once + +#include "PRMap.h" + +class DativPR : public PRMap +{ +public: + DativPR() + { + // clang-format off + m_ages = { + { 4, 0 }, + { 5, 0 }, + { 6, 0 }, + { 7, 0 }, + { 8, 0 }, + { 9, 0 } + }; + + m_PRs = { + { 3, 1, 1, 0, 0 }, + { 4, 1, 1, 1, 0 }, + { 8, 3, 1, 1, 1 }, + { 11, 5, 1, 1, 1 }, + { 18, 9, 3, 1, 1 }, + { 23, 12, 4, 3, 2 }, + { 31, 15, 8, 3, 2 }, + { 38, 19, 11, 5, 3 }, + { 42, 24, 14, 6, 3 }, + { 46, 27, 16, 8, 5 }, + { 51, 32, 20, 9, 9 }, + { 54, 35, 24, 11, 9 }, + { 57, 38, 26, 13, 9 }, + { 60, 42, 31, 15, 11 }, + { 61, 45, 35, 16, 12 }, + { 65, 46, 37, 18, 13 }, + { 67, 49, 37, 19, 13 }, + { 69, 53, 38, 22, 13 }, + { 72, 53, 40, 23, 16 }, + { 74, 58, 43, 26, 17 }, + { 76, 60, 45, 33, 19 }, + { 78, 67, 52, 39, 26 }, + { 87, 75, 61, 51, 37 }, + { 92, 87, 76, 68, 60 }, + { 100, 100, 100, 100, 100 } + }; + // clang-format on + } +}; diff --git a/source/ResultWidget/ResultModel.cpp b/source/ResultWidget/ResultModel.cpp index 24a7686..bad17df 100644 --- a/source/ResultWidget/ResultModel.cpp +++ b/source/ResultWidget/ResultModel.cpp @@ -3,6 +3,8 @@ #include "PluralPR.h" #include "GenusPR.h" #include "VerbEndPR.h" +#include "AkkusativPR.h" +#include "DativPR.h" #include @@ -150,6 +152,7 @@ void ResultModel::setAkkusativResult(unsigned int points) if (m_results[5].points() != points) { m_results[5].setPoints(points); + m_results[5].setPR(AkkusativPR().lookup(m_age, points)); emit dataChanged(index(0, 5), index(4, 5)); } } @@ -159,6 +162,7 @@ void ResultModel::setDativResult(unsigned int points) if (m_results[6].points() != points) { m_results[6].setPoints(points); + m_results[6].setPR(DativPR().lookup(m_age, points)); emit dataChanged(index(0, 6), index(4, 6)); } }