added late skills test

This commit is contained in:
Michael Mandl 2018-06-26 16:59:51 +02:00
parent 76264eb814
commit 0a1eea0fe2
18 changed files with 303 additions and 3 deletions

View file

@ -0,0 +1,39 @@
#pragma once
#include "PRMap.h"
class GenitivPR : public PRMap
{
public:
GenitivPR()
{
// clang-format off
m_ages = {
{ 7, 0 },
{ 7, 6 },
{ 8, 0 },
{ 9, 0 }
};
m_PRs = {
{ 0, 0, 0 },
{ 1, 3, 0 },
{ 2, 3, 0 },
{ 2, 5, 1 },
{ 7, 5, 1 },
{ 8, 6, 1 },
{ 14, 8, 2 },
{ 18, 9, 4 },
{ 21, 17, 7 },
{ 29, 18, 8 },
{ 38, 29, 14 },
{ 50, 42, 23 },
{ 66, 54, 33 },
{ 82, 68, 51 },
{ 90, 83, 72 },
{ 96, 92, 87 },
{ 100, 100, 100 }
};
// clang-format on
}
};

View file

@ -0,0 +1,32 @@
#pragma once
#include "PRMap.h"
class PassivPR : public PRMap
{
public:
PassivPR()
{
// clang-format off
m_ages = {
{ 7, 0 },
{ 8, 6 },
{ 9, 0 }
};
m_PRs = {
{ 1, 0 },
{ 2, 0 },
{ 6, 2 },
{ 9, 3 },
{ 23, 12 },
{ 34, 23 },
{ 55, 41 },
{ 71, 59 },
{ 85, 76 },
{ 94, 84 },
{ 100, 100 }
};
// clang-format on
}
};

View file

@ -7,6 +7,8 @@
#include "DativPR.h"
#include "V2PR.h"
#include "SvkPR.h"
#include "PassivPR.h"
#include "GenitivPR.h"
#include <QDebug>
@ -188,3 +190,23 @@ void ResultModel::setSvkResult(unsigned int points)
emit dataChanged(index(0, 1), index(4, 1));
}
}
void ResultModel::setPassivResult(unsigned int points)
{
if (m_results[3].points() != points)
{
m_results[3].setPoints(points);
m_results[3].setPR(PassivPR().lookup(m_age, points));
emit dataChanged(index(0, 3), index(4, 3));
}
}
void ResultModel::setGenitivResult(unsigned int points)
{
if (m_results[7].points() != points)
{
m_results[7].setPoints(points);
m_results[7].setPR(GenitivPR().lookup(m_age, points));
emit dataChanged(index(0, 7), index(4, 7));
}
}

View file

@ -70,4 +70,6 @@ public:
void setDativResult(unsigned int points);
void setV2Result(unsigned int points);
void setSvkResult(unsigned int points);
void setPassivResult(unsigned int points);
void setGenitivResult(unsigned int points);
};