Add first class Head#

This commit is contained in:
usermeme 2018-09-09 15:30:38 +03:00
parent 2784ad3d6d
commit 1e7fea081d
4 changed files with 116 additions and 2 deletions

53
.gitignore vendored Normal file
View File

@ -0,0 +1,53 @@
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
*.exe
# Qt-es
/Build*
*.stash
/Release*
/parts/*
/prime/*
/snap/.snapcraft/*
/stage/*
/Build-*
/Release-*
*.stash
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
Makefile*
*build-*
*.snap
snake
# QtCreator
installer/HanoiTowersInstaller
*.autosave
# QtCtreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCtreator CMake
CMakeLists.txt.user*
\.buildconfig

33
back-end/head.cpp Normal file
View File

@ -0,0 +1,33 @@
#include "head.h"
double Head::getAngle() const {
return angle;
}
void Head::setAngle(double angle) {
this->angle = angle;
}
double Head::getY() const {
return y;
}
void Head::setY(double y) {
this->y = y;
}
double Head::getX() const {
return x;
}
void Head::setX(double x) {
this->x = x;
}
Head::Head() {
}
Head::~Head() {
}

26
back-end/head.h Normal file
View File

@ -0,0 +1,26 @@
#ifndef HEAD_H
#define HEAD_H
#include "baseclass.h"
#include <QString>
class Head : BaseClass
{
private:
double x,y,angle;
QString texture;
public:
Head();
double getAngle() const;
void setAngle(double angle);
double getY() const;
void setY(double y);
double getX() const;
void setX(double x);
~Head();
};
#endif // HEAD_H

View File

@ -14,7 +14,8 @@ DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
back-end/main.cpp \
back-end/baseclass.cpp
back-end/baseclass.cpp \
back-end/head.cpp
RESOURCES += qml.qrc
@ -30,4 +31,5 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADERS += \
back-end/baseclass.h
back-end/baseclass.h \
back-end/head.h