Skip to content

Commit

Permalink
Cleanup imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett committed Sep 7, 2023
1 parent 12f5f29 commit 27095fb
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 32 deletions.
3 changes: 2 additions & 1 deletion src/bullet.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{enemy::death, layer, Armor, HitPoints, StatusEffect, StatusEffects, TaipoState};
use bevy::prelude::*;

use crate::{enemy::death, layer, Armor, HitPoints, StatusEffect, StatusEffects, TaipoState};

pub struct BulletPlugin;

impl Plugin for BulletPlugin {
Expand Down
6 changes: 3 additions & 3 deletions src/data.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use crate::{japanese_parser, TypingTarget};

use bevy::{
asset::{AssetLoader, AssetPath, LoadContext, LoadedAsset},
prelude::*,
reflect::{TypePath, TypeUuid},
utils::{BoxedFuture, HashMap},
};
use bevy_common_assets::ron::RonAssetPlugin;

use bevy_common_assets::ron::RonAssetPlugin;
use serde::Deserialize;

use crate::{japanese_parser, TypingTarget};

// Tower stats, prices, etc should go in here eventually
#[derive(Debug, Deserialize)]
#[serde(rename = "GameData")]
Expand Down
6 changes: 4 additions & 2 deletions src/enemy.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use bevy::{ecs::query::Or, prelude::*};

use rand::{thread_rng, Rng};

use crate::{
healthbar::HealthBar,
layer,
loading::{EnemyAnimationHandles, TextureHandles},
update_currency_text, ActionPanel, AfterUpdate, AnimationData, Armor, Currency, Goal,
HitPoints, Speed, StatusDownSprite, StatusEffects, StatusUpSprite, TaipoState,
};
use bevy::{ecs::query::Or, prelude::*};
use rand::{thread_rng, Rng};

pub struct EnemyPlugin;

Expand Down
4 changes: 2 additions & 2 deletions src/game_over.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use bevy::prelude::*;

use crate::{
enemy::AnimationState, loading::FontHandles, ui_color, wave::Waves, AfterUpdate, Currency,
Goal, HitPoints, TaipoState, FONT_SIZE,
};
use bevy::prelude::*;

pub struct GameOverPlugin;

impl Plugin for GameOverPlugin {
Expand Down
3 changes: 2 additions & 1 deletion src/healthbar.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{layer, AfterUpdate, HitPoints, TaipoState};
use bevy::prelude::*;

use crate::{layer, AfterUpdate, HitPoints, TaipoState};

pub struct HealthBarPlugin;

impl Plugin for HealthBarPlugin {
Expand Down
4 changes: 3 additions & 1 deletion src/loading.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::{data::AnimationData, map::TiledMap, GameData, TaipoState};
use bevy::prelude::*;

use bevy_asset_loader::prelude::*;

use crate::{data::AnimationData, map::TiledMap, GameData, TaipoState};

pub struct LoadingPlugin;

impl Plugin for LoadingPlugin {
Expand Down
18 changes: 8 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,33 @@ use bevy::{
utils::HashMap,
window::PrimaryWindow,
};

use bevy_ecs_tilemap::TilemapPlugin;
use game_over::GameOverPlugin;
use loading::{FontHandles, LevelHandles, TextureHandles, UiTextureHandles};
use reticle::{Reticle, ReticlePlugin};
use typing::TypingTargetSettings;
use ui_color::TRANSPARENT_BACKGROUND;
use wave::{Wave, WavePlugin, WaveState, Waves};
use tiled::{ObjectShape, PropertyValue};

use crate::{
bullet::BulletPlugin,
data::{AnimationData, GameData, GameDataPlugin},
enemy::EnemyPlugin,
game_over::GameOverPlugin,
healthbar::{HealthBar, HealthBarPlugin},
loading::LoadingPlugin,
loading::{FontHandles, LevelHandles, LoadingPlugin, TextureHandles, UiTextureHandles},
main_menu::MainMenuPlugin,
map::{TiledMap, TiledMapPlugin},
reticle::{Reticle, ReticlePlugin},
tower::{
TowerBundle, TowerChangedEvent, TowerKind, TowerPlugin, TowerSprite, TowerState,
TowerStats, TOWER_PRICE,
},
typing::{
AsciiModeEvent, TypingPlugin, TypingTarget, TypingTargetBundle, TypingTargetContainer,
TypingTargetFinishedEvent, TypingTargetImage, TypingTargetPriceContainer,
TypingTargetPriceText, TypingTargetText, TypingTargets,
TypingTargetPriceText, TypingTargetSettings, TypingTargetText, TypingTargets,
},
ui_color::TRANSPARENT_BACKGROUND,
wave::{Wave, WavePlugin, WaveState, Waves},
};

use tiled::{ObjectShape, PropertyValue};

extern crate anyhow;

mod bullet;
Expand Down
4 changes: 2 additions & 2 deletions src/main_menu.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use bevy::prelude::*;

use rand::{prelude::SliceRandom, thread_rng};

use crate::{
data::WordList,
data::WordListMenuItem,
data::{WordList, WordListMenuItem},
loading::{FontHandles, GameDataHandles, LevelHandles},
map::TiledMapBundle,
typing::TypingTargets,
Expand Down
12 changes: 6 additions & 6 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use bevy::{
prelude::*,
reflect::{TypePath, TypeUuid},
};

use bevy_ecs_tilemap::prelude::*;
use std::{collections::HashMap, io::BufReader};

Expand Down Expand Up @@ -159,12 +160,11 @@ pub fn process_loaded_maps(
// tilesets on each layer and allows differently-sized tile images in each tileset,
// this means we need to load each combination of tileset and layer separately.
for (tileset_index, tileset) in tiled_map.map.tilesets().iter().enumerate() {
let Some(tilemap_texture) = tiled_map
.tilemap_textures
.get(&tileset_index) else {
warn!("Skipped creating layer with missing tilemap textures.");
continue;
};
let Some(tilemap_texture) = tiled_map.tilemap_textures.get(&tileset_index)
else {
warn!("Skipped creating layer with missing tilemap textures.");
continue;
};

let tile_size = TilemapTileSize {
x: tileset.tile_width as f32,
Expand Down
4 changes: 3 additions & 1 deletion src/tower.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use bevy::prelude::*;

use crate::{
bullet, enemy::EnemyKind, layer, typing_target_finished_event, AfterUpdate, HitPoints,
RangeIndicator, StatusDownSprite, StatusEffect, StatusEffectKind, StatusEffects,
StatusUpSprite, TaipoState, TextureHandles, TowerSelection,
};
use bevy::prelude::*;

pub struct TowerPlugin;

impl Plugin for TowerPlugin {
Expand Down
4 changes: 2 additions & 2 deletions src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use bevy::{
prelude::*,
};

use std::collections::VecDeque;

use crate::{
loading::AudioHandles, ui_color::TRANSPARENT_BACKGROUND, Action, AudioSettings, FontHandles,
TaipoState, FONT_SIZE_INPUT,
};

use std::collections::VecDeque;

pub struct TypingPlugin;

impl Plugin for TypingPlugin {
Expand Down
3 changes: 2 additions & 1 deletion src/wave.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::anyhow;
use bevy::{prelude::*, utils::HashMap};

use anyhow::anyhow;
use tiled::{Object, PropertyValue};

use crate::{
Expand Down

0 comments on commit 27095fb

Please sign in to comment.