Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
generative_art_cartoon
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package 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
Finn Bear
generative_art_cartoon
Commits
063e1cb8
Commit
063e1cb8
authored
2 years ago
by
Finn Bear
Browse files
Options
Downloads
Patches
Plain Diff
Remove extraenous blank grid state.
parent
32ccab9d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/slide/s4_automata.rs
+7
-15
7 additions, 15 deletions
src/slide/s4_automata.rs
with
7 additions
and
15 deletions
src/slide/s4_automata.rs
+
7
−
15
View file @
063e1cb8
...
...
@@ -25,11 +25,7 @@ pub struct Automata {
conway_portrait
:
Option
<
TextureHandle
>
,
}
#[derive(Default)]
enum
AutomataState
{
/// Nothing on the grid.
#[default]
Empty
,
/// Random colors on the grid, but no simulation.
Static
{
/// When started fading in "alive" arrow.
...
...
@@ -54,9 +50,15 @@ impl Default for Automata {
// Unique identifier for the grid.
life
.name
=
"life"
;
randomize_grid
(
&
mut
life
);
Self
{
life
,
state
:
AutomataState
::
default
(),
state
:
AutomataState
::
Static
{
alive
:
None
,
dead
:
None
,
rules
:
[
None
;
3
],
},
governor
:
Governor
::
default
(),
conway_portrait
:
None
,
}
...
...
@@ -66,15 +68,6 @@ impl Default for Automata {
impl
Slide
for
Automata
{
fn
transition
(
&
mut
self
,
ctx
:
&
Context
)
->
bool
{
match
&
mut
self
.state
{
AutomataState
::
Empty
=>
{
self
.state
=
AutomataState
::
Static
{
alive
:
None
,
dead
:
None
,
rules
:
[
None
;
3
],
};
randomize_grid
(
&
mut
self
.life
);
}
AutomataState
::
Static
{
alive
,
dead
,
rules
}
=>
{
// Enable arrows/text one by one.
if
alive
.is_none
()
{
...
...
@@ -135,7 +128,6 @@ impl Slide for Automata {
const
HORIZONTAL_OFFSET
:
f32
=
250.0
;
match
&
mut
self
.state
{
AutomataState
::
Empty
=>
{}
AutomataState
::
Static
{
rules
,
..
}
=>
{
if
let
Some
(
first_rule_fade_start
)
=
rules
[
0
]
{
let
elapsed
=
ui
.ctx
()
.input
()
.time
-
first_rule_fade_start
;
...
...
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