Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Romain De Laage De Bellefaye
LO21-projet
Commits
88b4415d
Verified
Commit
88b4415d
authored
Jun 11, 2021
by
Romain De Laage De Bellefaye
🌳
Browse files
Add error message when no previous state available
parent
e9ddfb09
Pipeline
#79686
passed with stage
in 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
includes/Automate.h
View file @
88b4415d
...
...
@@ -94,9 +94,12 @@ class Automate {
/// Se placer sur l'état précédent si disponible
void
previous
()
{
if
(
itBuffer
!=
buffer
.
begin
())
if
(
itBuffer
!=
buffer
.
begin
())
{
itBuffer
--
;
AutoCell
::
getInstance
().
afficherGrille
(
&*
itBuffer
);
AutoCell
::
getInstance
().
afficherGrille
(
&*
itBuffer
);
}
else
throw
"No more state available before in the buffer (max: 15)"
;
}
/// Se placer sur l'état suivant si disponible
void
next
()
{
if
(
itBuffer
!=
(
--
buffer
.
end
()))
itBuffer
++
;
}
...
...
src/autocell.cpp
View file @
88b4415d
...
...
@@ -407,5 +407,12 @@ void AutoCell::next() {
}
void
AutoCell
::
previous
()
{
Automate
::
getInstance
().
previous
();
try
{
Automate
::
getInstance
().
previous
();
}
catch
(
const
char
*
m
)
{
QString
msg
(
m
);
afficherErreur
(
msg
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment