Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Кукочкина София Александровна
Lab_3
Commits
4446dedc
Commit
4446dedc
authored
1 month ago
by
Кукочкина София Александровна
Browse files
Options
Download
Patches
Plain Diff
Created the classes of states
parent
98201d25
main
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
application.cpp
+3
-1
application.cpp
application.h
+35
-0
application.h
with
38 additions
and
1 deletion
+38
-1
application.cpp
+
3
−
1
View file @
4446dedc
#include
"application.h"
#include
<iostream>
int
main
()
{
std
::
cout
<<
"it`s pacman!"
;
Application
app
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
application.h
+
35
−
0
View file @
4446dedc
class
IState
;
class
IStateManager
{
public:
IStateManager
()
=
default
;
virtual
~
IStateManager
()
{};
virtual
void
set_next_state
(
IState
*
state
)
const
=
0
;
};
class
IState
{
public:
IState
(
IStateManager
&
state_manager
)
:
m_state_manager
(
state_manager
)
{}
virtual
bool
do_step
()
=
0
;
protected
:
IStateManager
&
m_state_manager
;
};
class
Application
:
public
IStateManager
{
public:
int
run
()
{
}
private
:
void
set_next_state
(
IState
*
ptr_state
)
const
override
{
}
void
apply_deffer_state_change
()
{
}
private
:
IState
*
m_ptr_state_next
;
IState
*
m_ptr_state_current
;
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets