use super::ChunkPlacementId;
use molgfx_core::{AnalyticTemplate, ResidencyTicket};
use molgfx_math::Rgba8;
use std::sync::Arc;
#[derive(Clone, Debug)]
pub struct InstanceChunkPlacement {
id: ChunkPlacementId,
ticket: ResidencyTicket,
template: Arc<AnalyticTemplate>,
color: Rgba8,
}
impl PartialEq for InstanceChunkPlacement {
fn eq(&self, other: &Self) -> bool {
self.id == other.id
&& self.ticket == other.ticket
&& Arc::ptr_eq(&self.template, &other.template)
&& self.color == other.color
}
}
impl InstanceChunkPlacement {
#[must_use]
pub fn new(
id: ChunkPlacementId,
ticket: ResidencyTicket,
template: Arc<AnalyticTemplate>,
color: Rgba8,
) -> Self {
Self {
id,
ticket,
template,
color,
}
}
#[must_use]
pub const fn id(&self) -> ChunkPlacementId {
self.id
}
#[must_use]
pub const fn ticket(&self) -> ResidencyTicket {
self.ticket
}
#[must_use]
pub const fn template(&self) -> &Arc<AnalyticTemplate> {
&self.template
}
#[must_use]
pub const fn color(&self) -> Rgba8 {
self.color
}
}