@@ -7,22 +7,14 @@ use bevy::prelude::*;
77const TEXT_COLOR : Color = Color :: rgb ( 0.9 , 0.9 , 0.9 ) ;
88
99// Enum that will be used as a global state for the game
10- #[ derive( Clone , Copy , Default , Eq , PartialEq , Debug , Hash ) ]
10+ #[ derive( Clone , Copy , Default , Eq , PartialEq , Debug , Hash , States ) ]
1111enum GameState {
1212 #[ default]
1313 Splash ,
1414 Menu ,
1515 Game ,
1616}
1717
18- impl States for GameState {
19- type Iter = std:: array:: IntoIter < GameState , 3 > ;
20-
21- fn variants ( ) -> Self :: Iter {
22- [ GameState :: Splash , GameState :: Menu , GameState :: Game ] . into_iter ( )
23- }
24- }
25-
2618// One of the two settings that can be set through the menu. It will be a resource in the app
2719#[ derive( Resource , Debug , Component , PartialEq , Eq , Clone , Copy ) ]
2820enum DisplayQuality {
@@ -312,7 +304,7 @@ mod menu {
312304 }
313305
314306 // State used for the current menu screen
315- #[ derive( Clone , Copy , Default , Eq , PartialEq , Debug , Hash ) ]
307+ #[ derive( Clone , Copy , Default , Eq , PartialEq , Debug , Hash , States ) ]
316308 enum MenuState {
317309 Main ,
318310 Settings ,
@@ -322,21 +314,6 @@ mod menu {
322314 Disabled ,
323315 }
324316
325- impl States for MenuState {
326- type Iter = std:: array:: IntoIter < MenuState , 5 > ;
327-
328- fn variants ( ) -> Self :: Iter {
329- [
330- MenuState :: Main ,
331- MenuState :: Settings ,
332- MenuState :: SettingsDisplay ,
333- MenuState :: SettingsSound ,
334- MenuState :: Disabled ,
335- ]
336- . into_iter ( )
337- }
338- }
339-
340317 // Tag component used to tag entities added on the main menu screen
341318 #[ derive( Component ) ]
342319 struct OnMainMenuScreen ;
0 commit comments