Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "Excercise.h"
- #include <cstdlib>
- #include "structs.h"
- Excercise::Excercise(Fraction f1, Fraction f2)
- :m_FractionOne{ f1 }, m_FractionTwo{ f2 }, m_SmallerThan{ "Resources/smallerThan.png" }, m_OK{ "Resources/Ok.png" }, m_Nok{"Resources/Nok.png"}
- , m_No{ "Resources/No.png" }, m_Yes{"Resources/Yes.png"}
- {
- }
- void Excercise::Draw(const Point2f & Bottomleft)
- {
- m_FractionOne.Draw(Point2f{ Bottomleft.x, Bottomleft.y }, false);
- m_SmallerThan.Draw(Point2f{ Bottomleft.x + 70, Bottomleft.y});
- m_FractionTwo.Draw(Point2f{ Bottomleft.x + 140, Bottomleft.y }, false);
- if (CheckSamllest() == true)
- {
- m_OK.Draw(Point2f{ Bottomleft.x + 280, Bottomleft.y });
- }
- else
- {
- m_Nok.Draw(Point2f{ Bottomleft.x + 280, Bottomleft.y });
- }
- }
- bool Excercise::CheckSamllest()
- {
- if (m_FractionOne < m_FractionTwo)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- void Excercise::YorN(bool isyes)
- {
- if (isyes == true)
- {
- m_Yes.Draw(Point2f{ 100 + 210, 100 });
- }
- else if(isyes == false)
- {
- m_No.Draw(Point2f{ 100 + 210, 100 });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement