Skip to content

Commit

Permalink
Re-organizing messing use-statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
b-guild committed Dec 25, 2024
1 parent 9398a5a commit 6b87d54
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 81 deletions.
15 changes: 5 additions & 10 deletions editor/src/plugins/tilemap/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,27 @@
// SOFTWARE.

use fyrox::{
core::{color::Color, log::Log, pool::Handle, ImmutableString, Uuid},
core::{algebra::Vector2, color::Color, log::Log, pool::Handle, ImmutableString, Uuid},
fxhash::FxHashMap,
material::MaterialResource,
scene::{
node::Node,
tilemap::{
brush::{TileMapBrushPage, TileMapBrushResource},
swap_hash_map_entry,
tileset::{
AbstractTile, NamableValue, NamedValue, TileSetColliderLayer, TileSetPage,
TileSetPageSource, TileSetPropertyLayer, TileSetPropertyType, TileSetPropertyValue,
TileSetResource,
},
OrthoTransform, OrthoTransformation, TileCollider, TileDefinitionHandle, TileMap,
TileSetUpdate, TilesUpdate,
},
},
};

use crate::{
command::{CommandContext, CommandTrait},
fyrox::{
core::algebra::Vector2,
scene::tilemap::{
brush::{TileMapBrushPage, TileMapBrushResource},
swap_hash_map_entry,
tileset::TileSetResource,
TileSetUpdate, TilesUpdate,
},
},
scene::commands::GameSceneContext,
};

Expand Down
10 changes: 3 additions & 7 deletions editor/src/plugins/tilemap/handle_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use fyrox::gui::{
button::ButtonMessage,
text::{TextBuilder, TextMessage},
Control,
};

use crate::{
fyrox::gui::{
button::ButtonMessage,
define_constructor, define_widget_deref,
grid::{Column, GridBuilder, Row},
stack_panel::StackPanelBuilder,
text::{TextBuilder, TextMessage},
text_box::TextBoxBuilder,
widget::Widget,
Orientation,
Control, Orientation,
},
send_sync_message,
};
Expand Down
1 change: 0 additions & 1 deletion editor/src/plugins/tilemap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ use crate::fyrox::{
debug::Line,
node::Node,
tilemap::{
brush::TileMapBrush,
tileset::{TileSet, TileSetResource},
RandomTileSource, Stamp, TileCollider, TileDefinitionHandle, TileMap, TilePaletteStage,
TileResource, Tiles,
Expand Down
11 changes: 5 additions & 6 deletions editor/src/plugins/tilemap/palette.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use fyrox::fxhash::FxHashSet;
use fyrox::gui::message::CursorIcon;
use fyrox::scene::tilemap::tileset::{TileSetPageSource, TileSetRef};
use fyrox::scene::tilemap::{OrthoTransformation, TileSource};

use crate::asset::item::AssetItem;
use crate::fyrox::{
core::{
Expand All @@ -35,20 +30,24 @@ use crate::fyrox::{
visitor::prelude::*,
},
fxhash::FxHashMap,
fxhash::FxHashSet,
graph::BaseSceneGraph,
gui::{
brush::Brush,
define_constructor, define_widget_deref,
draw::{CommandTexture, Draw, DrawingContext},
formatted_text::{FormattedText, FormattedTextBuilder},
message::CursorIcon,
message::{KeyCode, MessageDirection, MouseButton, UiMessage},
widget::{Widget, WidgetBuilder, WidgetMessage},
BuildContext, Control, UiNode, UserInterface,
},
material::{Material, MaterialResource},
resource::texture::TextureKind,
scene::tilemap::{
TilePaletteStage, TileRect, TileRenderData, TileResource, TileSetUpdate, TransTilesUpdate,
tileset::{TileSetPageSource, TileSetRef},
OrthoTransformation, TilePaletteStage, TileRect, TileRenderData, TileResource,
TileSetUpdate, TileSource, TransTilesUpdate,
},
};
use std::cell::RefCell;
Expand Down
25 changes: 12 additions & 13 deletions editor/src/plugins/tilemap/panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use brush::TileMapBrushResource;
use fyrox::{
core::algebra::Vector2,
gui::{
grid::SizeMode,
stack_panel::StackPanelBuilder,
text::{TextBuilder, TextMessage},
window::Window,
},
scene::tilemap::{tileset::TileSet, TileResource, *},
};

use crate::{
asset::item::AssetItem,
fyrox::{
core::algebra::Vector2,
core::color::Color,
core::pool::Handle,
graph::{BaseSceneGraph, SceneGraph},
Expand All @@ -49,9 +38,19 @@ use crate::{
BuildContext, HorizontalAlignment, Orientation, Thickness, UiNode, UserInterface,
VerticalAlignment,
},
gui::{
grid::SizeMode,
stack_panel::StackPanelBuilder,
text::{TextBuilder, TextMessage},
window::Window,
},
scene::tilemap::{tileset::TileSet, TileResource, *},
scene::{
node::Node,
tilemap::{brush::TileMapBrush, TileMap},
tilemap::{
brush::{TileMapBrush, TileMapBrushResource},
TileMap,
},
},
},
message::MessageSender,
Expand Down
8 changes: 2 additions & 6 deletions editor/src/plugins/tilemap/panel_preview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use fyrox::{
gui::formatted_text::{FormattedText, FormattedTextBuilder},
scene::tilemap::TileSource,
};

use crate::fyrox::{
core::{
algebra::{Matrix3, Vector2},
Expand All @@ -32,6 +27,7 @@ use crate::fyrox::{
type_traits::prelude::*,
visitor::prelude::*,
},
gui::formatted_text::{FormattedText, FormattedTextBuilder},
gui::{
brush::Brush,
define_widget_deref,
Expand All @@ -41,7 +37,7 @@ use crate::fyrox::{
BuildContext, Control, UiNode, UserInterface,
},
resource::texture::TextureKind,
scene::tilemap::TileRenderData,
scene::tilemap::{TileRenderData, TileSource},
};
use std::ops::{Deref, DerefMut};

Expand Down
3 changes: 1 addition & 2 deletions editor/src/plugins/tilemap/tile_inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ use crate::{
plugins::material::editor::{MaterialFieldEditorBuilder, MaterialFieldMessage},
send_sync_message, MSG_SYNC_FLAG,
};
use brush::TileMapBrushPage;
use fyrox::{
asset::{manager::ResourceManager, ResourceDataRef},
core::{
Expand All @@ -45,7 +44,7 @@ use fyrox::{
BuildContext, UiNode, UserInterface,
},
material::{MaterialResource, MaterialResourceExtension},
scene::tilemap::{tileset::*, *},
scene::tilemap::{brush::*, tileset::*, *},
};

use super::*;
Expand Down
24 changes: 9 additions & 15 deletions editor/src/plugins/tilemap/tileset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,30 @@ use crate::{
command::{Command, CommandGroup},
fyrox::{
asset::manager::ResourceManager,
core::{color::Color, log::Log, pool::Handle},
core::{algebra::Vector2, color::Color, log::Log, pool::Handle},
engine::SerializationContext,
gui::{
border::BorderBuilder,
brush::Brush,
button::ButtonMessage,
color::{ColorFieldBuilder, ColorFieldMessage},
grid::SizeMode,
grid::{Column, GridBuilder, Row},
message::{MessageDirection, UiMessage},
scroll_viewer::ScrollViewerBuilder,
stack_panel::StackPanelBuilder,
tab_control::{TabControl, TabControlBuilder, TabControlMessage, TabDefinition},
text::TextBuilder,
text::TextMessage,
widget::{WidgetBuilder, WidgetMessage},
window::{WindowBuilder, WindowMessage, WindowTitle},
BuildContext, Thickness, UiNode, UserInterface,
},
scene::tilemap::TileDefinitionHandle,
scene::tilemap::{tileset::TileSetRef, TileDefinitionHandle, TileResource},
},
message::MessageSender,
plugins::inspector::editors::resource::{ResourceFieldBuilder, ResourceFieldMessage},
};
use fyrox::gui::text::TextBuilder;
use fyrox::{
core::algebra::Vector2,
gui::{
color::{ColorFieldBuilder, ColorFieldMessage},
grid::SizeMode,
scroll_viewer::ScrollViewerBuilder,
stack_panel::StackPanelBuilder,
tab_control::{TabControl, TabControlBuilder, TabControlMessage, TabDefinition},
text::TextMessage,
},
scene::tilemap::{tileset::TileSetRef, TileResource},
};
use palette::{PaletteWidgetBuilder, DEFAULT_MATERIAL_COLOR};
use std::sync::Arc;

Expand Down
5 changes: 2 additions & 3 deletions fyrox-impl/src/scene/tilemap/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
// SOFTWARE.

use crate::core::{
algebra::Vector2, color::Color, reflect::prelude::*, type_traits::prelude::*,
visitor::prelude::*, ImmutableString,
algebra::Vector2, color::Color, num_traits::Euclid, reflect::prelude::*,
type_traits::prelude::*, visitor::prelude::*, ImmutableString,
};
use fyrox_core::num_traits::Euclid;
use std::fmt::{Display, Formatter};

use super::*;
Expand Down
6 changes: 2 additions & 4 deletions fyrox-impl/src/scene/tilemap/tile_collider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ use crate::{
use std::{
any::Any,
error::Error,
fmt::{Display, Formatter},
};
use std::{fmt::Debug, str::FromStr};
use std::{
fmt::{Debug, Display, Formatter},
num::{ParseFloatError, ParseIntError},
path::Path,
str::FromStr,
};
use strum_macros::{AsRefStr, EnumString, VariantNames};

Expand Down
2 changes: 1 addition & 1 deletion fyrox-impl/src/scene/tilemap/tile_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

use crate::{
core::{algebra::Vector2, reflect::prelude::*, visitor::prelude::*},
fxhash::FxHashMap,
rand::{seq::IteratorRandom, thread_rng},
};
use fxhash::FxHashMap;
use std::{
fmt::{Debug, Display, Formatter},
ops::{Deref, DerefMut},
Expand Down
15 changes: 6 additions & 9 deletions fyrox-impl/src/scene/tilemap/tileset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,28 @@
//! Tile set is a special storage for tile descriptions. It is a sort of database, that contains
//! descriptions (definitions) for tiles. See [`TileSet`] docs for more info and usage examples.
use crate::material::MaterialResourceExtension;
use crate::resource::texture::TextureResource;
use crate::{
asset::{
io::ResourceIo,
loader::{BoxedLoaderFuture, LoaderPayload, ResourceLoader},
manager::ResourceManager,
state::LoadError,
untyped::UntypedResource,
Resource, ResourceData, ResourceDataRef,
},
core::{
algebra::Vector2, color::Color, io::FileLoadError, reflect::prelude::*,
algebra::Vector2, color::Color, io::FileLoadError, log::Log, reflect::prelude::*,
type_traits::prelude::*, visitor::prelude::*, ImmutableString,
},
material::MaterialResource,
fxhash::{FxHashMap, FxHashSet},
material::{MaterialResource, MaterialResourceExtension},
resource::texture::TextureResource,
};
use fxhash::{FxHashMap, FxHashSet};
use fyrox_core::log::Log;
use std::collections::hash_map::{Entry, Keys};
use std::ops::{Deref, DerefMut};
use std::{
any::Any,
collections::hash_map::{Entry, Keys},
error::Error,
fmt::{Display, Formatter},
ops::{Deref, DerefMut},
path::{Path, PathBuf},
sync::Arc,
};
Expand Down
10 changes: 6 additions & 4 deletions fyrox-impl/src/scene/tilemap/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
// SOFTWARE.

use super::*;
use crate::core::{algebra::Vector2, color::Color, type_traits::prelude::*};
use crate::core::{algebra::Vector2, color::Color, log::Log, type_traits::prelude::*};
use fxhash::FxHashMap;
use fyrox_core::log::Log;
use std::ops::{Deref, DerefMut};
use std::{borrow::Cow, collections::hash_map::Entry};
use std::{
borrow::Cow,
collections::hash_map::Entry,
ops::{Deref, DerefMut},
};

struct BresenhamLineIter {
dx: i32,
Expand Down

0 comments on commit 6b87d54

Please sign in to comment.