Selaa lähdekoodia

clean imports

Bastien Sevajol 3 vuotta sitten
vanhempi
commit
7523cb0588
4 muutettua tiedostoa jossa 15 lisäystä ja 27 poistoa
  1. 4 20
      src/main.rs
  2. 2 2
      src/scene/item.rs
  3. 8 4
      src/scene/main.rs
  4. 1 1
      src/ui/mod.rs

+ 4 - 20
src/main.rs Näytä tiedosto

@@ -1,31 +1,15 @@
1
-use std::cmp;
2
-use std::collections::HashMap;
3 1
 use std::env;
4 2
 use std::path;
5 3
 
6
-use ggez;
7
-use ggez::{event, input};
8
-use ggez::{Context, GameResult};
9
-use ggez::event::{KeyCode, MouseButton};
10
-use ggez::graphics;
11
-use ggez::graphics::{Color, DrawMode, FillOptions, MeshBuilder, StrokeOptions};
12
-use ggez::timer::check_update_time;
13
-use glam::Vec2;
14
-
15
-use behavior::ItemBehavior;
16
-use physics::{MetaEvent, PhysicEvent, util};
17
-use scene::item::{ItemState, SceneItem, SceneItemSpriteInfo, SceneItemType};
18 4
 use scene::main::MainState;
19
-use scene::SpriteType;
20
-use ui::{SceneItemPrepareOrder, UiItem, UiSpriteInfo, UserEvent};
21
-use ui::scene_item_menu::SceneItemMenuItem;
22 5
 
23
-use crate::physics::position::GridPosition;
6
+use ggez::{event, GameResult};
7
+use glam::Vec2;
24 8
 
9
+mod behavior;
25 10
 mod physics;
26
-mod ui;
27 11
 mod scene;
28
-mod behavior;
12
+mod ui;
29 13
 
30 14
 // TODO: create a ScenePosition and a WindowPosition to be more explicit
31 15
 type Point2 = Vec2;

+ 2 - 2
src/scene/item.rs Näytä tiedosto

@@ -1,10 +1,10 @@
1 1
 use ggez::graphics;
2 2
 
3
-use crate::{Point2, SCENE_ITEMS_SPRITE_SHEET_HEIGHT, SCENE_ITEMS_SPRITE_SHEET_WIDTH};
4 3
 use crate::behavior::ItemBehavior;
5
-use crate::physics::{MetaEvent, util};
6 4
 use crate::physics::position::GridPosition;
5
+use crate::physics::{util, MetaEvent};
7 6
 use crate::scene::SpriteType;
7
+use crate::{Point2, SCENE_ITEMS_SPRITE_SHEET_HEIGHT, SCENE_ITEMS_SPRITE_SHEET_WIDTH};
8 8
 
9 9
 pub struct SceneItemSpriteInfo {
10 10
     pub relative_start_y: f32,

+ 8 - 4
src/scene/main.rs Näytä tiedosto

@@ -1,18 +1,22 @@
1 1
 use std::cmp;
2 2
 use std::collections::HashMap;
3 3
 
4
-use ggez::{Context, event, GameResult, graphics, input};
5 4
 use ggez::event::MouseButton;
6 5
 use ggez::graphics::{DrawMode, MeshBuilder, StrokeOptions};
7 6
 use ggez::timer::check_update_time;
7
+use ggez::{event, graphics, input, Context, GameResult};
8 8
 
9
-use crate::{ANIMATE_EACH, DEFAULT_SELECTED_SQUARE_SIDE, DEFAULT_SELECTED_SQUARE_SIDE_HALF, DISPLAY_OFFSET_BY, DISPLAY_OFFSET_BY_SPEED, MAX_FRAME_I, META_EACH, PHYSICS_EACH, Point2, SCENE_ITEMS_CHANGE_ERR_MSG, SPRITE_EACH, TARGET_FPS};
10 9
 use crate::behavior::ItemBehavior;
11
-use crate::physics::{MetaEvent, PhysicEvent, util};
12 10
 use crate::physics::position::GridPosition;
11
+use crate::physics::{util, MetaEvent, PhysicEvent};
13 12
 use crate::scene::item::{ItemState, SceneItem, SceneItemType};
14
-use crate::ui::{SceneItemPrepareOrder, UiItem, UiSpriteInfo, UserEvent};
15 13
 use crate::ui::scene_item_menu::SceneItemMenuItem;
14
+use crate::ui::{SceneItemPrepareOrder, UiItem, UiSpriteInfo, UserEvent};
15
+use crate::{
16
+    Point2, ANIMATE_EACH, DEFAULT_SELECTED_SQUARE_SIDE, DEFAULT_SELECTED_SQUARE_SIDE_HALF,
17
+    DISPLAY_OFFSET_BY, DISPLAY_OFFSET_BY_SPEED, MAX_FRAME_I, META_EACH, PHYSICS_EACH,
18
+    SCENE_ITEMS_CHANGE_ERR_MSG, SPRITE_EACH, TARGET_FPS,
19
+};
16 20
 use ggez::input::keyboard::KeyCode;
17 21
 
18 22
 pub struct MainState {

+ 1 - 1
src/ui/mod.rs Näytä tiedosto

@@ -1,8 +1,8 @@
1 1
 use ggez::graphics;
2 2
 
3
-use crate::{Point2, UI_SPRITE_SHEET_HEIGHT, UI_SPRITE_SHEET_WIDTH};
4 3
 use crate::scene::item::SceneItem;
5 4
 use crate::ui::scene_item_menu::SceneItemMenuItem;
5
+use crate::{Point2, UI_SPRITE_SHEET_HEIGHT, UI_SPRITE_SHEET_WIDTH};
6 6
 
7 7
 pub mod scene_item_menu;
8 8