Skip to content

Commit

Permalink
cargo fmt --all to pass lints
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahShomette committed Apr 8, 2023
1 parent a097230 commit fa40e73
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 24 deletions.
1 change: 1 addition & 0 deletions src/abilities/nuke.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

11 changes: 5 additions & 6 deletions src/actions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,22 @@ pub fn ended_controls(
if keyboard_input.just_pressed(KeyCode::Space) {
next_state.set(GameState::Menu);

for entity in tiles.iter(){
for entity in tiles.iter() {
commands.entity(entity).despawn();
}
for entity in objects.iter(){
for entity in objects.iter() {
commands.entity(entity).despawn();
}
for entity in players.iter(){
for entity in players.iter() {
commands.entity(entity).despawn();
}
for entity in player_marker.iter(){
for entity in player_marker.iter() {
commands.entity(entity).despawn();
}

commands.remove_resource::<Game>();
commands.init_resource::<GameBuildSettings>();
}

}

pub fn update_actions(
Expand Down
4 changes: 2 additions & 2 deletions src/ai/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::actions::Actions;
use crate::actions::Actions;
use crate::color_system::ColorConflicts;
use crate::game::GameData;
use crate::player::PlayerPoints;
Expand Down Expand Up @@ -33,7 +33,7 @@ pub fn run_ai(
if player_points.building_points < 50 && player_points.ability_points < 50 {
continue;
}

let mut sorted_highest_conflicts: Vec<(TilePos, usize)> = vec![];
for (tile_pos, player_id_vec) in color_conflicts.conflicts.iter().filter(|value| {
let tile_entity = tile_storage.get(&value.0).unwrap();
Expand Down
4 changes: 2 additions & 2 deletions src/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl Plugin for InternalAudioPlugin {
#[derive(Resource)]
struct FlyingAudio(Handle<AudioInstance>);

fn start_audio(mut commands: Commands, audio_assets: Res<AudioAssets>, audio: Res<Audio>) {
fn start_audio(mut commands: Commands, audio_assets: Res<AudioAssets>, audio: Res<Audio>) {
/*
audio.pause();
let handle = audio
Expand All @@ -31,7 +31,7 @@ fn start_audio(mut commands: Commands, audio_assets: Res<AudioAssets>, audio: Re
.with_volume(0.3)
.handle();
commands.insert_resource(FlyingAudio(handle));
*/
}

Expand Down
3 changes: 1 addition & 2 deletions src/buildings/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub mod line;
pub mod line;
pub mod pulser;
pub mod scatter;

Expand Down Expand Up @@ -26,7 +26,6 @@ pub fn destroy_buildings(
&BuildingMarker,
),
With<Object>,

>,
mut tiles: Query<(Entity, &PlayerMarker), (Without<Object>, With<Tile>)>,
mut tile_storage_query: Query<(&MapId, &TileStorage)>,
Expand Down
3 changes: 1 addition & 2 deletions src/color_system.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::buildings::Building;
use crate::buildings::Building;
use crate::player::PlayerPoints;
use bevy::app::{App, Plugin};
use bevy::prelude::{
Expand Down Expand Up @@ -155,7 +155,6 @@ pub fn handle_color_conflicts(
if let TileColorStrength::Five = tile_color.tile_color_strength {
//id_hashmap.remove(&highest.0);
handle_conflicts = false;

} else {
tile_color.strengthen();
commands.entity(entity).insert(Changed::default());
Expand Down
4 changes: 2 additions & 2 deletions src/game/end_game.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use bevy::prelude::{Commands, Mut, NextState, Query, Res, ResMut, Resource, With};
use crate::GameState;
use bevy::prelude::{Commands, Mut, NextState, Query, Res, ResMut, Resource, With};
use bevy::utils::HashMap;
use bevy_ggf::game_core::Game;
use bevy_ggf::mapping::tiles::Tile;
use bevy_ggf::player::PlayerMarker;
use crate::GameState;

#[derive(Default, Resource)]
pub struct GameEnded {
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use bevy::prelude::*;
use bevy::window::{PrimaryWindow, WindowMode};
use bevy::winit::WinitWindows;
use bevy::DefaultPlugins;
use bevy_ascii_terminal::TerminalPlugin;
use clrs::GamePlugin;
use std::io::Cursor;
use bevy_ascii_terminal::TerminalPlugin;
use winit::window::Icon;

fn main() {
Expand Down
12 changes: 6 additions & 6 deletions src/map.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
use bevy::ecs::system::SystemState;
use crate::color_system::TileColorStrength;
use bevy::ecs::system::SystemState;
use bevy::prelude::{Commands, Entity, Mut, Query, Reflect, World};
use bevy_ecs_tilemap::prelude::*;
use bevy_ggf::game_core::command::{GameCommand, GameCommands};
use bevy_ggf::mapping::{Map, MapDeSpawned, MapId, MapIdProvider, MapSpawned, SpawnRandomMap};
use bevy_ggf::mapping::terrain::{TerrainType, TileTerrainInfo};
use bevy_ggf::mapping::tiles::{BggfTileBundle, BggfTileObjectBundle, Tile, TileObjects, TileObjectStacks};
use bevy_ggf::mapping::tiles::{
BggfTileBundle, BggfTileObjectBundle, Tile, TileObjectStacks, TileObjects,
};
use bevy_ggf::mapping::{Map, MapDeSpawned, MapId, MapIdProvider, MapSpawned, SpawnRandomMap};
use bevy_ggf::movement::TerrainMovementCosts;
use bevy_ggf::player::PlayerList;
use crate::color_system::TileColorStrength;

pub trait MapCommandsExt {
fn spawn_testing_map(
Expand Down Expand Up @@ -64,8 +66,6 @@ impl GameCommand for SpawnTestingMap {
let mut tile_storage = TileStorage::empty(map_size);
let tilemap_type = self.tilemap_type;
let tilemap_entity = world.spawn_empty().id();



world.resource_scope(|world, terrain_movement_costs: Mut<TerrainMovementCosts>| {
for x in 0..map_size.x {
Expand Down
1 change: 0 additions & 1 deletion src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pub struct PlayerPlugin;
pub struct PlayerPoints {
pub building_points: u32,
pub ability_points: u32,

}

/// This plugin handles player related stuff like movement
Expand Down

0 comments on commit fa40e73

Please sign in to comment.