use glam::f32::Vec2;
use serde::{Deserialize, Serialize};

use crate::components::*;

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum PlayerUpdate {
    Move(PlayerMoveInputEvent),
    Shoot(PlayerShootInputEvent),
    Use(GameEntityId),
    // The player wants to exit the current game session
    Exit,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ClientMessage {
    JoinGame(GameEntityId),
    LeaveGame,
    PlayerInputEvent(PlayerInputEvent),
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum PlayerInputEvent {
    Move(PlayerMoveInputEvent),
    Shoot(PlayerShootInputEvent),
    Use(GameEntityId),
    // The player wants to exit the current game session
    Exit,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PlayerMoveInputEvent {
    pub direction: Vec2,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PlayerShootInputEvent {
    pub direction: Vec2,
}

use glam::f32::Vec2;
use serde::{Deserialize, Serialize};

use crate::components::*;

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum PlayerUpdate {
    Move(PlayerMoveInputEvent),
    Shoot(PlayerShootInputEvent),
    Use(GameEntityId),
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum ClientMessage {
    JoinGame(GameEntityId),
    LeaveGame,
    PlayerInputEvent(PlayerInputEvent),
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum PlayerInputEvent {
    Move(PlayerMoveInputEvent),
    Shoot(PlayerShootInputEvent),
    Use(GameEntityId),
    // The player wants to exit the current game session
    Exit,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PlayerMoveInputEvent {
    pub direction: Vec2,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct PlayerShootInputEvent {
    pub direction: Vec2,
}

Remove Exit variant from PlayerUpdate
Remove Exit variant from PlayerUpdate
