Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
harmadik_beadando_UHK213
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Monoki Dorina
harmadik_beadando_UHK213
Commits
62c74616
Commit
62c74616
authored
1 year ago
by
Monoki Dorina
Browse files
Options
Downloads
Patches
Plain Diff
jatszhato de nem tud szabalyokat
parent
ec7f7534
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
application.cpp
+9
-0
9 additions, 0 deletions
application.cpp
application.hpp
+1
-0
1 addition, 0 deletions
application.hpp
field.cpp
+20
-38
20 additions, 38 deletions
field.cpp
main.cpp
+6
-0
6 additions, 0 deletions
main.cpp
widget.hpp
+0
-6
0 additions, 6 deletions
widget.hpp
with
36 additions
and
44 deletions
application.cpp
+
9
−
0
View file @
62c74616
...
...
@@ -54,6 +54,15 @@ void Application::event_loop()
widgets
[
9
*
focus
.
sor
+
focus
.
oszlop
]
->
kezel
(
ev
);
}
if
(
ev
.
keycode
>=
49
&&
ev
.
keycode
<=
57
)
{
action
(
9
*
focus
.
sor
+
focus
.
oszlop
,
ev
.
keycode
-
48
);
}
if
(
ev
.
keycode
==
key_delete
||
ev
.
keycode
==
key_backspace
)
{
action
(
9
*
focus
.
sor
+
focus
.
oszlop
,
0
);
}
}
for
(
Widget
*
w
:
widgets
)
...
...
This diff is collapsed.
Click to expand it.
application.hpp
+
1
−
0
View file @
62c74616
...
...
@@ -34,6 +34,7 @@ class Application
virtual
void
event_loop
();
virtual
void
register_widget
(
Widget
*
);
virtual
void
register_gm
(
GameMaster
*
);
virtual
void
action
(
int
,
int
)
=
0
;
protected:
std
::
vector
<
Widget
*>
widgets
;
...
...
This diff is collapsed.
Click to expand it.
field.cpp
+
20
−
38
View file @
62c74616
#include
"field.hpp"
#include
<string>
#include
<iostream>
using
namespace
genv
;
...
...
@@ -12,23 +13,6 @@ Field::Field(Application* parent, int x, int y, int meret, int index, int ertek)
void
Field
::
rajzol
()
const
{
/// keret
if
(
_kijelolt
)
{
if
(
_fix
)
gout
<<
color
(
light_grey
);
else
gout
<<
color
(
light_purple
);
}
else
{
if
(
_fix
)
gout
<<
color
(
dark_grey
);
else
gout
<<
color
(
dark_purple
);
}
gout
<<
move_to
(
_x
,
_y
)
<<
box
(
_szel
,
_mag
);
/// hatter
if
(
_kijelolt
)
{
...
...
@@ -51,9 +35,9 @@ void Field::rajzol() const
else
gout
<<
color
(
light_purple
);
}
gout
<<
move_to
(
_x
+
1
,
_y
+
1
)
<<
box
(
_szel
-
2
,
_mag
-
2
);
gout
<<
move_to
(
_x
,
_y
)
<<
box
(
_szel
,
_mag
);
///
vonalak
///
keret, szoveg
if
(
_kijelolt
)
{
if
(
_fix
)
...
...
@@ -69,27 +53,23 @@ void Field::rajzol() const
gout
<<
color
(
dark_purple
);
}
// keret
gout
<<
move_to
(
_x
,
_y
)
<<
line
(
_szel
,
0
)
<<
line
(
0
,
_mag
)
<<
line
(
-
_szel
,
0
)
<<
line
(
0
,
-
_mag
);
// vonalak
if
((
_index
%
9
)
%
3
==
0
)
// bal
gout
<<
move_to
(
_x
+
1
,
_y
)
<<
line
(
0
,
_mag
);
if
((
_index
%
9
)
%
3
==
2
)
//jobb
gout
<<
move_to
(
_x
+
_szel
-
2
,
_y
)
<<
line
(
0
,
_mag
);
gout
<<
move_to
(
_x
+
1
,
_y
)
<<
line
(
0
,
_mag
);
/// szoveg
if
(
_kijelolt
)
{
if
(
_fix
)
gout
<<
color
(
light_grey
);
else
gout
<<
color
(
light_purple
);
}
else
{
if
(
_fix
)
gout
<<
color
(
dark_grey
);
else
gout
<<
color
(
dark_purple
);
}
if
((
_index
%
9
)
%
3
==
2
)
// jobb
gout
<<
move_to
(
_x
+
_szel
-
2
,
_y
)
<<
line
(
0
,
_mag
);
if
((
_index
/
9
)
%
3
==
0
)
// font
gout
<<
move_to
(
_x
,
_y
+
1
)
<<
line
(
_szel
,
0
);
if
((
_index
/
9
)
%
3
==
2
)
// lent
gout
<<
move_to
(
_x
,
_y
+
_mag
-
2
)
<<
line
(
_szel
,
0
);
// szoveg
if
(
_ertek
)
{
gout
<<
move_to
(
_x
+
(
_szel
-
gout
.
twidth
(
std
::
to_string
(
_ertek
)))
/
2
,
...
...
@@ -101,9 +81,11 @@ void Field::rajzol() const
void
Field
::
kezel
(
genv
::
event
ev
)
{
_kijelolt
=!
_kijelolt
;
std
::
cout
<<
_ertek
<<
std
::
endl
;
}
void
Field
::
set_ertek
(
int
uj
)
{
_ertek
=
uj
;
if
(
!
_fix
)
_ertek
=
uj
;
}
This diff is collapsed.
Click to expand it.
main.cpp
+
6
−
0
View file @
62c74616
...
...
@@ -26,6 +26,12 @@ class MyApp : public Application
}
}
void
action
(
int
i
,
int
be
)
{
palya
[
i
]
->
set_ertek
(
be
);
game
->
action
();
}
protected
:
vector
<
Field
*>
palya
;
GameMaster
*
game
;
...
...
This diff is collapsed.
Click to expand it.
widget.hpp
+
0
−
6
View file @
62c74616
...
...
@@ -4,12 +4,6 @@
#include
"graphics.hpp"
#include
"application.hpp"
/*#define dark_purple 130,37,184
#define light_purple 210,145,255
#define bg_purple 246,232,255
#define white 255,255,255
#define black 0,0,0*/
#define dark_purple 56,0,102
#define mid_purple 133,133,255
#define light_purple 204,204,255
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment