Formated all files

This commit is contained in:
Dmitriy Shishkov 2022-05-28 17:28:35 +03:00
parent 4dd5a1742a
commit c119e5265a
No known key found for this signature in database
GPG Key ID: 26720CB2A9608C97
14 changed files with 53 additions and 53 deletions

5
.clang-format Normal file
View File

@ -0,0 +1,5 @@
BreakBeforeBraces: Attach
IndentWidth: 4
PointerAlignment: Left
AllowShortFunctionsOnASingleLine: Inline
AccessModifierOffset: -4

16
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${default}"
],
"defines": [],
"compilerPath": "/usr/bin/clang",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "linux-clang-x64"
}
],
"version": 4
}

View File

@ -75,6 +75,10 @@
"thread": "cpp", "thread": "cpp",
"typeinfo": "cpp", "typeinfo": "cpp",
"variant": "cpp", "variant": "cpp",
"*.xpm": "cpp" "*.xpm": "cpp",
} "cfenv": "cpp",
"charconv": "cpp",
"shared_mutex": "cpp"
},
"C_Cpp.default.cppStandard": "c++20"
} }

View File

@ -1,5 +1,4 @@
#include "AboutDlg.h" #include "AboutDlg.h"
AboutDlg::AboutDlg(wxWindow *parent, wxWindowID id) : wxDialog::wxDialog(parent, id, _("О программе")) AboutDlg::AboutDlg(wxWindow* parent, wxWindowID id)
{ : wxDialog::wxDialog(parent, id, _("О программе")) {}
}

View File

@ -3,10 +3,9 @@
#include "wxw.h" #include "wxw.h"
class AboutDlg : public wxDialog class AboutDlg : public wxDialog {
{
public: public:
AboutDlg(wxWindow *parent, wxWindowID id); AboutDlg(wxWindow* parent, wxWindowID id);
}; };
#endif #endif

View File

@ -3,13 +3,12 @@
wxIMPLEMENT_APP(MyApp); wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit() bool MyApp::OnInit() {
{
wxImage::AddHandler(new wxPNGHandler()); wxImage::AddHandler(new wxPNGHandler());
MainFrame *frame = new MainFrame(); MainFrame* frame = new MainFrame();
frame->Show(true); frame->Show(true);
SetTopWindow(frame); SetTopWindow(frame);
return true; return true;
} }

3
App.h
View File

@ -3,8 +3,7 @@
#include "wxw.h" #include "wxw.h"
class MyApp : public wxApp class MyApp : public wxApp {
{
public: public:
virtual bool OnInit() override; virtual bool OnInit() override;
}; };

View File

@ -1,5 +1,5 @@
#include "HelpDlg.h" #include "HelpDlg.h"
HelpDlg::HelpDlg(wxWindow *parent, wxWindowID id) : wxDialog::wxDialog(parent, id, _("Инструкция по использованию программы")) HelpDlg::HelpDlg(wxWindow* parent, wxWindowID id)
{ : wxDialog::wxDialog(parent, id,
} _("Инструкция по использованию программы")) {}

View File

@ -3,10 +3,9 @@
#include "wxw.h" #include "wxw.h"
class HelpDlg : public wxDialog class HelpDlg : public wxDialog {
{
public: public:
HelpDlg(wxWindow *parent, wxWindowID id); HelpDlg(wxWindow* parent, wxWindowID id);
}; };
#endif #endif

View File

@ -5,12 +5,10 @@
#include "GamePanel.h" #include "GamePanel.h"
#include <wx/stdpaths.h>
#include <wx/filename.h> #include <wx/filename.h>
#include <wx/stdpaths.h>
/// @uml{style[#line.dotted:blue]} class MainFrame : public wxFrame {
class MainFrame : public wxFrame
{
public: public:
MainFrame(); MainFrame();
@ -18,18 +16,18 @@ private:
void initMenu(); void initMenu();
void bindMenu(); void bindMenu();
GamePanel *panel; GamePanel* panel;
bool openLayout(); bool openLayout();
const wxString dataDirPath; const wxString dataDirPath;
wxString layoutPath; wxString layoutPath;
bool solveable = false; // determites wether to generate solveable or completely random map bool solveable = false; // determites wether to generate solveable or
// completely random map
}; };
enum enum {
{
IDM_Open = wxID_OPEN, IDM_Open = wxID_OPEN,
IDM_Exit = wxID_EXIT, IDM_Exit = wxID_EXIT,
IDM_Help = wxID_HELP, IDM_Help = wxID_HELP,

View File

@ -1,5 +1,4 @@
#include "RulesDlg.h" #include "RulesDlg.h"
RulesDlg::RulesDlg(wxWindow *parent, wxWindowID id) : wxDialog::wxDialog(parent, id, _("Правила игры")) RulesDlg::RulesDlg(wxWindow* parent, wxWindowID id)
{ : wxDialog::wxDialog(parent, id, _("Правила игры")) {}
}

View File

@ -3,10 +3,9 @@
#include "wxw.h" #include "wxw.h"
class RulesDlg : public wxDialog class RulesDlg : public wxDialog {
{
public: public:
RulesDlg(wxWindow *parent, wxWindowID id); RulesDlg(wxWindow* parent, wxWindowID id);
}; };
#endif #endif

View File

@ -1,6 +1,6 @@
#include "XmlLayout.h" #include "XmlLayout.h"
XmlLayout::XmlLayout() : path("") { } XmlLayout::XmlLayout() : path("") {}
bool XmlLayout::openFile(const wxString& openPath) { bool XmlLayout::openFile(const wxString& openPath) {
if (openPath.IsSameAs(path)) if (openPath.IsSameAs(path))
@ -16,9 +16,9 @@ bool XmlLayout::openFile(const wxString& openPath) {
} }
Dimensions XmlLayout::getDimensions() { Dimensions XmlLayout::getDimensions() {
return { wxAtoi(layoutDoc.GetRoot()->GetAttribute("layers")), return {wxAtoi(layoutDoc.GetRoot()->GetAttribute("layers")),
wxAtoi(layoutDoc.GetRoot()->GetAttribute("ux")) + 2, wxAtoi(layoutDoc.GetRoot()->GetAttribute("ux")) + 2,
wxAtoi(layoutDoc.GetRoot()->GetAttribute("uy")) + 2 }; wxAtoi(layoutDoc.GetRoot()->GetAttribute("uy")) + 2};
} }
void XmlLayout::readLayout(TLVec& table) { void XmlLayout::readLayout(TLVec& table) {

16
wxw.h
View File

@ -12,20 +12,4 @@
#endif #endif
#define _(s) wxString::FromUTF8(s) #define _(s) wxString::FromUTF8(s)
// class wxTrackable {};
// class wxObject {};
// class wxEventHandler : wxObject, wxTrackable {};
// class wxEventFilter {};
// class wxAppConsole : wxEventHandler, wxEventFilter {};
// class wxApp : wxAppConsole {};
// class wxWindow : wxEventHandler {};
// class wxNotOwnedWindow : wxWindow {};
// class wxTopLevelWindow : wxNotOwnedWindow {};
// class wxFrame : wxTopLevelWindow {};
// class wxCommandEvent {};
// #define DECLARE_EVENT_TABLE() void none();
#endif #endif