diff options
| author | mat <github@matdoes.dev> | 2021-12-15 23:10:55 -0600 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2021-12-15 23:10:55 -0600 |
| commit | 9642558f8f8d983a7087f15d68be8cf07a85f0c2 (patch) | |
| tree | 5f0a967f005cd5db510a13ab290c8ad6669b25aa /azalea-chat/src/translatable_component.rs | |
| parent | 72aefe871ca4983431b1a0b707b472e73ffea836 (diff) | |
| download | azalea-drasl-9642558f8f8d983a7087f15d68be8cf07a85f0c2.tar.xz | |
azalea
Diffstat (limited to 'azalea-chat/src/translatable_component.rs')
| -rw-r--r-- | azalea-chat/src/translatable_component.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/azalea-chat/src/translatable_component.rs b/azalea-chat/src/translatable_component.rs new file mode 100644 index 00000000..0709f7bf --- /dev/null +++ b/azalea-chat/src/translatable_component.rs @@ -0,0 +1,24 @@ +use crate::{base_component::BaseComponent, component::Component}; + +#[derive(Clone, Debug)] +pub enum StringOrComponent { + String(String), + Component(Component), +} + +#[derive(Clone, Debug)] +pub struct TranslatableComponent { + pub base: BaseComponent, + pub key: String, + pub args: Vec<StringOrComponent>, +} + +impl TranslatableComponent { + pub fn new(key: String, args: Vec<StringOrComponent>) -> Self { + Self { + base: BaseComponent::new(), + key, + args, + } + } +} |
