Skip to content

Commit

Permalink
clean up access control modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmorrow committed Jul 20, 2023
1 parent 9546893 commit 6787536
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/level.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ impl Plugin for LevelPlugin {
}
}

pub struct Level {
pub id: u32,
pub blocks: Vec<BlockBundle>,
pub jump_collision_block_boxes: Vec<JumpCollisionBoxBundle>,
struct Level {
id: u32,
blocks: Vec<BlockBundle>,
jump_collision_block_boxes: Vec<JumpCollisionBoxBundle>,
}

impl Level {
pub fn new(id: u32) -> Self {
fn new(id: u32) -> Self {
debug!("Creating level (id: {})", id);

let num_blocks = match id {
Expand Down Expand Up @@ -55,7 +55,7 @@ impl Level {

impl Resource for Level {}

pub fn spawn_blocks(mut commands: Commands, level: Res<Level>) {
fn spawn_blocks(mut commands: Commands, level: Res<Level>) {
debug!("Spawning blocks");
for block in level.blocks.iter() {
commands.spawn(block.clone());
Expand Down
10 changes: 5 additions & 5 deletions src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use bevy::{prelude::*, window::PrimaryWindow};
use bevy_xpbd_2d::prelude::*;
use leafwing_input_manager::prelude::*;

pub mod grapple;
mod grapple;

const SIZE: f32 = 64.0;
const SIZE_VEC2: Vec2 = Vec2::new(SIZE, SIZE);
Expand All @@ -24,7 +24,7 @@ impl Plugin for PlayerPlugin {
pub struct Player;

#[derive(Bundle, Default)]
pub struct PlayerBundle {
struct PlayerBundle {
sprite_bundle: SpriteBundle,
rigid_body: RigidBody,
collider: Collider,
Expand All @@ -37,7 +37,7 @@ pub struct PlayerBundle {
}

impl PlayerBundle {
pub fn new(asset_server: Res<AssetServer>, window: &Window) -> Self {
fn new(asset_server: Res<AssetServer>, window: &Window) -> Self {
debug!("Creating player bundle");

let mut input_map = InputMap::default();
Expand Down Expand Up @@ -91,7 +91,7 @@ pub enum Action {
#[derive(Resource, Default)]
pub struct CanJump(pub bool);

pub fn spawn(
fn spawn(
mut commands: Commands,
asset_server: Res<AssetServer>,
window_query: Query<&Window, With<PrimaryWindow>>,
Expand Down Expand Up @@ -131,7 +131,7 @@ pub fn r#move(
}
}

pub fn can_jump(
fn can_jump(
mut collisions: EventReader<Collision>,
mut can_jump: ResMut<CanJump>,
query: Query<(
Expand Down
4 changes: 2 additions & 2 deletions src/player/grapple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ impl Plugin for GrapplePlugin {
}

#[derive(States, Debug, Clone, Eq, PartialEq, Hash)]
pub enum GrappleState {
enum GrappleState {
Idle,
Aiming,
Grappling,
}

impl GrappleState {
pub fn next(&self) -> Self {
fn next(&self) -> Self {
match self {
Self::Idle => Self::Aiming,
Self::Aiming => Self::Grappling,
Expand Down

0 comments on commit 6787536

Please sign in to comment.