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
ae238a13
Commit
ae238a13
authored
Jun 02, 2021
by
Leon Do Castelo
Browse files
Update Automate.h : implementation push leon
parent
4d561e6d
Pipeline
#79055
passed with stage
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
includes/Automate.h
View file @
ae238a13
...
...
@@ -14,7 +14,13 @@ class Automate {
unsigned
int
delai
;
Fonction
*
fonction
;
RegleVoisinage
*
regleVoisinage
;
Automate
()
:
delai
(
500
),
fonction
(
nullptr
),
regleVoisinage
(
nullptr
)
{}
std
::
list
<
Reseau
>
buffer
;
//ajouté
std
::
list
<
Reseau
>::
iterator
itBuffer
;
//ajouté
unsigned
int
h
;
//ajouté pour construire des réseaux
unsigned
int
l
;
//de même
bool
isRunning
;
//ajouté
Automate
()
:
delai
(
500
),
fonction
(
nullptr
),
regleVoisinage
(
nullptr
),
itBuffer
(
buffer
.
begin
()),
h
(
0
),
l
(
0
),
isRunning
(
false
)
{}
//modifié
Automate
(
const
Automate
&
a
)
=
delete
;
Automate
&
operator
=
(
const
Automate
&
a
)
=
delete
;
...
...
@@ -30,6 +36,21 @@ class Automate {
void
setFonction
(
Fonction
&
f
)
{
fonction
=
&
f
;
}
void
setRegleVoisinage
(
RegleVoisinage
&
r
)
{
regleVoisinage
=
&
r
;
}
void
setDelai
(
const
unsigned
int
d
)
{
delai
=
d
;
}
//nouvelles fonctions
void
setHauteur
(
unsigned
int
hauteur
)
{
h
=
hauteur
;
}
void
setLargeur
(
unsigned
int
largeur
)
{
l
=
largeur
;
}
void
previous
()
{
itBuffer
--
;
}
void
next
()
{
itBuffer
++
;
}
void
reset
()
{
itBuffer
=
buffer
.
begin
();
}
void
step
()
{
if
(
isRunning
)
{
nextTimer
();
itBuffer
++
;}
}
void
run
(
int
n
)
{
for
(
int
i
=
0
;
i
<
n
;
i
++
)
step
();
}
void
start
()
{
isRunning
=
true
;
}
void
pause
()
{
isRunning
=
false
;
}
};
#endif
Write
Preview
Supports
Markdown
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