16 lines
428 B
Rust
16 lines
428 B
Rust
use crate::data::LogicDataRef;
|
|
use titan::Payload;
|
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Payload)]
|
|
pub struct LogicDataSlot {
|
|
pub data: LogicDataRef,
|
|
#[codec(vint)]
|
|
pub count: i32,
|
|
}
|
|
impl LogicDataSlot {
|
|
pub fn new(data: LogicDataRef, count: i32) -> Self {
|
|
Self { data, count }
|
|
}
|
|
pub fn resource(&self) -> Option<crate::data::LogicResourceData> {
|
|
self.data.as_resource()
|
|
}
|
|
}
|