mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
solid is an enum
This commit is contained in:
parent
15c1c4e6eb
commit
243d2039c3
2 changed files with 26 additions and 4 deletions
|
|
@ -4,18 +4,26 @@ mod game;
|
|||
|
||||
use crate::data::*;
|
||||
use crate::Bsp;
|
||||
use std::fmt::{Debug, Formatter};
|
||||
use std::ops::Deref;
|
||||
|
||||
/// A handle represents a data structure in the bsp file and the bsp file containing it.
|
||||
///
|
||||
/// Keeping a reference of the bsp file with the data is required since a lot of data types
|
||||
/// reference parts from other structures in the bsp file
|
||||
#[derive(Debug)]
|
||||
pub struct Handle<'a, T> {
|
||||
bsp: &'a Bsp,
|
||||
data: &'a T,
|
||||
}
|
||||
|
||||
impl<T: Debug> Debug for Handle<'_, T> {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("Handle")
|
||||
.field("data", self.data)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for Handle<'_, T> {
|
||||
fn clone(&self) -> Self {
|
||||
Handle { ..*self }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue