use bevy::prelude::*;

use crate::player::Player;

// Yes I used chatgpt for this
// sue me, it's a mundane task :P
// - Mjork
pub fn log_positions(
    camera_query: Query<&Transform, With<Camera2d>>,
    player_query: Query<&Transform, With<Player>>,
) {
    // Log camera position
    if let Ok(camera_transform) = camera_query.get_single() {
        info!("Camera Position: {:?}", camera_transform.translation);
    } else {
        info!("Camera not found or multiple cameras detected.");
    }

    // Log player position
    if let Ok(player_transform) = player_query.get_single() {
        info!("Player Position: {:?}", player_transform.translation);
    } else {
        info!("Player not found or multiple players detected.");
    }
}
