Quick suggestion!
Opened this issue · 1 comments
Heyyo!
Found your project thanks to r/roguelikedev, and was given it a look when I noticed that your code in main.rs reset_game_state
is the exact same as the code in State::new()
That made me wonder if you could write the following instead? Hope to see more of your stuff on reddit!
fn reset_game_state(&mut self) {
*self = State::new();
}
Heyyo!
Found your project thanks to r/roguelikedev, and was given it a look when I noticed that your code in main.rs
reset_game_state
is the exact same as the code inState::new()
That made me wonder if you could write the following instead? Hope to see more of your stuff on reddit!
fn reset_game_state(&mut self) { *self = State::new(); }
WOAH I completely missed this!!!~ Never thought anyone would actually check this. I tried it out and yeah, that absolutely works! A few other DRY instances bug me, but I'm going to flesh out the game a bit more before tackling them. Good catch, and thank you so much for stopping by!