use crate::shared::*; #[derive(Bundle)] pub struct ProjectileBundle { pub projectile: Projectile, pub replicate: Replicate, } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] pub struct Projectile { pub type_: ProjectileType, pub source_player: PlayerId, pub damage: f32, } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] pub enum ProjectileType { Free(FreeProjectile), Instant(InstantProjectile), Targeted(TargetedProjectile), } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] pub struct FreeProjectile { pub position: Vec2, pub direction: Vec2, pub starting_position: Vec2, } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] pub struct InstantProjectile { pub target_player: PlayerId, } #[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)] pub struct TargetedProjectile { pub target_player: PlayerId, pub position: Vec2, }