Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Итоговый PR: mouseartiom #6

Open
wants to merge 92 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 69 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
8d368e7
added readme
stanf0rd Apr 7, 2018
45851b5
Создана базовая версия библиотеки для абстрактных классов.
Moleque Apr 7, 2018
3eec2bf
Исправлены ошибки компиляции
stanf0rd Apr 7, 2018
ae6d278
Добавлены новые классы предметов (subjects .h/.cpp).
Moleque Apr 8, 2018
b03829f
Конфликты разрешены.
Moleque Apr 8, 2018
1c9a669
Merge branch 'salman' into test
stanf0rd Apr 9, 2018
b4ee6c1
base .gitignore added
stanf0rd Apr 9, 2018
c0b02ee
Переименованны MovAble. Изменены конструкторы классов в subjects. Уда…
Moleque Apr 9, 2018
3d35bbf
abstract class Action added
stanf0rd Apr 10, 2018
47528ac
short chenged to int_fast8_t
stanf0rd Apr 10, 2018
77e8c10
Обновленный base.h
Moleque Apr 10, 2018
e598b20
merge test and salman branches
stanf0rd Apr 10, 2018
1150164
Initial commit
eadium Apr 10, 2018
14ab8f6
Merge branch 'mouseartiom' of github.com:Rasseki-Studios/rasseki.game…
eadium Apr 10, 2018
75405c8
Updated .gitignore
eadium Apr 10, 2018
094d958
added constructor/destructor
eadium Apr 10, 2018
fab1a91
Добавлены методы рассчета маршрута Move() и перемещения Step(). Id до…
Moleque Apr 11, 2018
866f45c
delete readme.md from test
Apr 11, 2018
f0c9cff
delete readme.md from test
Apr 11, 2018
2aedb01
delete readme.md from branch
Apr 11, 2018
13cc973
delete readme.md from branch
Apr 11, 2018
11a3566
Merge remote-tracking branch 'origin/salman' into salman
Apr 11, 2018
359a41d
delete readme.md from branch
Apr 11, 2018
4c61732
added getter and one color
eadium Apr 11, 2018
ec1c69e
Merge branch 'mouseartiom' of github.com:Rasseki-Studios/rasseki.game…
eadium Apr 11, 2018
7a99dcc
updated .gitignore
eadium Apr 11, 2018
728bab5
delete readme.md from branch
Apr 11, 2018
f6b95a0
Updated .gitignore
eadium Apr 11, 2018
291b5a7
Updated .gitignore
eadium Apr 11, 2018
4beb074
Merge branch 'mouseartiom' of github.com:Rasseki-Studios/rasseki.game…
eadium Apr 11, 2018
9bca0ee
const and inline added, pedantic lines swaps made
stanf0rd Apr 11, 2018
806dc48
Merge branch 'stanford' of github.com:Rasseki-Studios/rasseki.game in…
stanf0rd Apr 11, 2018
4a47cb9
Merge branch 'stanford' of github.com:Rasseki-Studios/rasseki.game in…
stanf0rd Apr 11, 2018
117a12a
ID are strings now, std::string can be used as str
stanf0rd Apr 12, 2018
b35eb9f
basic event.h and event.cpp added, class IFactory added
stanf0rd Apr 12, 2018
a5ddf66
IDs are now strings
stanf0rd Apr 12, 2018
dac9c26
id -> ID
stanf0rd Apr 12, 2018
949ca60
added namespace
eadium Apr 12, 2018
b91667f
Merge branch 'test' of github.com:Rasseki-Studios/rasseki.game into m…
eadium Apr 12, 2018
ce5db1e
Добавлены const к Get ф-циям.
Moleque Apr 12, 2018
24de712
slightly code refactored, removed namespace and added statics
eadium Apr 12, 2018
7d8b3e3
basic event reading added, base improved
stanf0rd Apr 12, 2018
8c18fe4
JV: add Qt project to Develop branch
Apr 12, 2018
a4d3713
save before move
Apr 12, 2018
3719cc5
Separate Qt project from Base, Map and Subjects
Apr 12, 2018
725f248
Remove .DS_Store from main folder
Apr 12, 2018
01ce70e
EventFabric can now read and use all event jsons
stanf0rd Apr 12, 2018
ccda882
libs were taken to libs folder
stanf0rd Apr 12, 2018
dc6ee0d
Merge branch 'stanford' into develop
stanf0rd Apr 12, 2018
c2a28d5
salman and develop branches merged
stanf0rd Apr 13, 2018
68ee06b
definition of class Movable was taken to individual file
stanf0rd Apr 13, 2018
a92b10d
fixed a small spelling error
stanf0rd Apr 13, 2018
e45f7b8
method getFromJson getting filename replaced method create
stanf0rd Apr 13, 2018
408afe4
catching exceptions in jsons, invalid events are skipping now
stanf0rd Apr 14, 2018
22b296a
Merge branch 'test' of github.com:Rasseki-Studios/rasseki.game into s…
stanf0rd Apr 14, 2018
c18fe16
fixed small spelling error
stanf0rd Apr 14, 2018
5c25f1a
EasyBMP library added
stanf0rd Apr 14, 2018
8def7a7
base transformed to item, movable and location parts
stanf0rd Apr 14, 2018
cd596b0
events support new base headers now
stanf0rd Apr 14, 2018
0d40f96
map renamed to mapdata
stanf0rd Apr 14, 2018
9246da3
mapdata updated for work with new base
stanf0rd Apr 14, 2018
3a70dea
stanford, test and mouseartiom branches are synchronized
stanf0rd Apr 14, 2018
68ddc13
updated .gitignore
eadium Apr 15, 2018
cb07a42
added eventsList but compilation fails
eadium Apr 17, 2018
b883c88
modified mapdata structure and added EventData class
eadium Apr 19, 2018
b4fa607
EventData -> EventsMapData and appropriate changes are made but this …
eadium Apr 20, 2018
e3e8bfb
added class EntityData but compilation fails though
eadium Apr 21, 2018
867879d
class EntityData made up to an end, small refactoring also
eadium Apr 21, 2018
38e25b1
removed files not corresponding to me
eadium Apr 21, 2018
116a39e
removed Qt
eadium May 1, 2018
47238a3
started work at sessions
eadium May 3, 2018
2854e54
code edited according to Google Style
eadium May 5, 2018
cbc78ac
small style improvements, new includes
stanf0rd May 7, 2018
02074f6
added GameData interfaces
eadium May 7, 2018
09bd86b
mapdata work comments for Artem
stanf0rd May 8, 2018
dfdf850
added MapScanner class
eadium May 8, 2018
f91d0e8
magic numbers were replaced ny enums
eadium May 9, 2018
11c583c
released alpha ver. of SessionData
eadium May 13, 2018
39d7b1c
Delete entitydata.cpp
eadium May 13, 2018
47bec5a
Delete entitydata.h
eadium May 13, 2018
b666d90
added validators for point and radius, removed unnecessary comments
eadium May 14, 2018
53c17c6
Merge branch 'mouseartiom' of github.com:Rasseki-Studios/rasseki.game…
eadium May 14, 2018
891f9fb
SurfaceData is now in surface.h. Namespace SessionData added.
eadium May 15, 2018
ea9832c
SurfaceData moved back to session_data.h
eadium May 15, 2018
1f5d458
added IsWalkable & GameData::Init(). Small fixes.
eadium May 15, 2018
3ffbe3b
Revert "added IsWalkable & GameData::Init(). Small fixes."
eadium May 16, 2018
615791c
session_data revived
eadium May 16, 2018
c346a49
renamed validators
eadium May 16, 2018
3985fb4
refactored code to be compilable
eadium May 16, 2018
ca6425c
changed project sructure for easier navigation
eadium May 31, 2018
3e7fa1d
synchronized with test
eadium Jun 13, 2018
7a508ea
synched with test
eadium Jun 20, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.[oa]
*vgcore*
.vscode/**
*.txt
*.out
*.exe
*test*
*.gch
41 changes: 41 additions & 0 deletions QtProject/adventure.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#-------------------------------------------------
#
# Project created by QtCreator 2018-04-12T00:30:21
#
#-------------------------------------------------

QT += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = adventure
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0


SOURCES += \
main.cpp \
mainwindow.cpp \
loading.cpp \
logbook.cpp \
mapfield.cpp

HEADERS += \
mainwindow.h \
loading.h \
logbook.h \
mapfield.h

FORMS += \
mainwindow.ui \
loading.ui
Binary file added QtProject/img/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions QtProject/loading.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "loading.h"
#include "ui_loading.h"

Loading::Loading(QWidget *parent) :
QWidget(parent),
ui(new Ui::Loading)
{
ui->setupUi(this);
}

Loading::~Loading()
{
delete ui;
}
22 changes: 22 additions & 0 deletions QtProject/loading.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef LOADING_H
#define LOADING_H

#include <QWidget>

namespace Ui {
class Loading;
}

class Loading : public QWidget
{
Q_OBJECT

public:
explicit Loading(QWidget *parent = 0);
~Loading();

private:
Ui::Loading *ui;
};

#endif // LOADING_H
19 changes: 19 additions & 0 deletions QtProject/loading.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Loading</class>
<widget class="QWidget" name="Loading">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
</widget>
<resources/>
<connections/>
</ui>
10 changes: 10 additions & 0 deletions QtProject/logbook.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include "logbook.h"

LogBook::LogBook(QWidget *parent) : QWidget(parent)
{

}

void printNewLine(QString newLine) {

}
18 changes: 18 additions & 0 deletions QtProject/logbook.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef LOGBOOK_H
#define LOGBOOK_H

#include <QWidget>

class LogBook : public QWidget
{
Q_OBJECT
public:
explicit LogBook(QWidget *parent = nullptr);

signals:

public slots:
void printNewLine(QString newLine);
};

#endif // LOGBOOK_H
29 changes: 29 additions & 0 deletions QtProject/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include "mainwindow.h"
#include <QApplication>
#include <QDebug>
#include <QPoint>
#include <QMouseEvent>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

где используется большая часть всех этих хедеров?

#include <QtWidgets>
#include "mapfield.h"


int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow mainWind;

mainWind.show();

return a.exec();
}

/*bool MapField::event(QMouseEvent *event)
{


return true;
}



url(./img/map.png)*/
35 changes: 35 additions & 0 deletions QtProject/mainwindow.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QDebug>
#include <QMouseEvent>

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);

MapField *mf = new MapField(this);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

где эти поля уничтожаются?
чтобы не терять такие моменты, следует использовать умные указатели - это как раз входит в задачи текущего модуля

LogBook *lb = new LogBook(this);

connect(mf, &MapField::sendNewLine, lb, &LogBook::printNewLine);

}

MainWindow::~MainWindow()
{
delete ui;
}

/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

qDebug() << "x = " << w.x();
qDebug() << "y = " << w.y();
qDebug() << "height = " << w.height();
qDebug() << "width = " << w.width();
QPoint pos = w.mapToGlobal(QPoint(0,0));
qDebug() << "x = " << pos.rx();
qDebug() << "y = " << pos.ry();
qDebug() << "x = " << pos.x();
qDebug() << "y = " << pos.y();
*/
26 changes: 26 additions & 0 deletions QtProject/mainwindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include "mapfield.h"
#include "logbook.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
Q_OBJECT

public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();

private:
Ui::MainWindow *ui;
//MapField *map;
};

#endif // MAINWINDOW_H
115 changes: 115 additions & 0 deletions QtProject/mainwindow.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1500</width>
<height>1000</height>
</rect>
</property>
<property name="windowTitle">
<string>MainWindow</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QLineEdit" name="enterDecisionLine">
<property name="geometry">
<rect>
<x>1000</x>
<y>960</y>
<width>501</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>enter smth</string>
</property>
</widget>
<widget class="QTextEdit" name="logBook">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>1000</x>
<y>270</y>
<width>501</width>
<height>691</height>
</rect>
</property>
<property name="acceptDrops">
<bool>false</bool>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;&quot; bgcolor=&quot;#0000ff&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;fsdfsdf&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;dfsdfsdf&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;dsfds&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;f&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;dsf&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;dsf&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;sd&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;fds&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;f&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;ds&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;fd&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;sf&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;ds&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;fsd&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;f&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;sd&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; color:#d6d6d6;&quot;&gt;f&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; color:#d6d6d6;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByMouse</set>
</property>
<property name="placeholderText">
<string/>
</property>
</widget>
<widget class="QTextEdit" name="heroInfo">
<property name="geometry">
<rect>
<x>1000</x>
<y>0</y>
<width>501</width>
<height>271</height>
</rect>
</property>
</widget>
<widget class="MapField" name="mapFieldWidget" native="true">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1001</width>
<height>1001</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: #ddbbcc;</string>
</property>
</widget>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>MapField</class>
<extends>QWidget</extends>
<header>mapfield.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
Binary file added QtProject/map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions QtProject/mapfield.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#include "mapfield.h"
#include <QDebug>
#include <QPoint>
#include <QMouseEvent>

MapField::MapField(QWidget *parent) : QWidget(parent)
{
}

void MapField::mouseReleaseEvent(QMouseEvent *e) {
qDebug() << "Mouse event worked";
QPoint point = e->pos();

qDebug() << point.x() << " and " << point.y();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

пока реализация не особо осмысленная..
и уже было замечание по поводу введения дополнительной сущности логгера, которую, к слову, тоже можно инициализировать на старте приложения

}
21 changes: 21 additions & 0 deletions QtProject/mapfield.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef MAPFIELD_H
#define MAPFIELD_H

#include <QWidget>

class MapField : public QWidget
{
Q_OBJECT
public:
explicit MapField(QWidget *parent = nullptr);

protected:
void mouseReleaseEvent(QMouseEvent *e);

signals:
void sendNewLine(QString newLine);

public slots:
};

#endif // MAPFIELD_H
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

Loading