use std::borrow::Cow;
use bevy_ecs::prelude::*;
use valence_text::Text;
use crate::{Decode, Encode, Packet};
#[derive(Clone, Debug, Encode, Decode, Packet)]
pub struct ScoreboardObjectiveUpdateS2c<'a> {
pub objective_name: &'a str,
pub mode: ObjectiveMode<'a>,
}
#[derive(Clone, PartialEq, Debug, Encode, Decode)]
pub enum ObjectiveMode<'a> {
Create {
objective_display_name: Cow<'a, Text>,
render_type: ObjectiveRenderType,
},
Remove,
Update {
objective_display_name: Cow<'a, Text>,
render_type: ObjectiveRenderType,
},
}
#[derive(Copy, Clone, PartialEq, Eq, Debug, Encode, Decode, Component, Default)]
pub enum ObjectiveRenderType {
#[default]
Integer,
Hearts,
}