mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-14 11:45:01 +01:00
more
This commit is contained in:
parent
a6a0db08f9
commit
d1546fe3fc
1 changed files with 2 additions and 64 deletions
|
|
@ -1,75 +1,13 @@
|
|||
use egui::Ui;
|
||||
#[cfg(feature = "derive")]
|
||||
pub use egui_inspect_derive as derive;
|
||||
use std::fmt::Debug;
|
||||
pub trait Inspect: Debug {
|
||||
|
||||
pub trait Inspect {
|
||||
fn inspect(&self, ui: &mut Ui, id_source: u64);
|
||||
fn inspect_mut(&mut self, ui: &mut Ui, id_source: u64) {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
pub trait UiExt {
|
||||
fn inspect<T: Inspect>(&mut self, what: &T, id_source: &mut u64);
|
||||
fn inspect_iter_with<'a, I, T, F>(
|
||||
&mut self,
|
||||
title: &str,
|
||||
into_iter: I,
|
||||
id_source: &mut u64,
|
||||
fun: F,
|
||||
) where
|
||||
I: IntoIterator<Item = &'a T>,
|
||||
T: 'a,
|
||||
F: FnMut(&mut Ui, usize, &T, &mut u64);
|
||||
fn inspect_iter_with_mut<'a, I, T, F>(
|
||||
&mut self,
|
||||
title: &str,
|
||||
into_iter: I,
|
||||
id_source: &mut u64,
|
||||
fun: F,
|
||||
) where
|
||||
I: IntoIterator<Item = &'a mut T>,
|
||||
T: 'a,
|
||||
F: FnMut(&mut Ui, usize, &mut T, &mut u64);
|
||||
fn inspect_mut<T: Inspect>(&mut self, what: &mut T, id_source: &mut u64);
|
||||
fn property<T: Inspect>(&mut self, name: &str, what: &mut T, id_source: &mut u64);
|
||||
}
|
||||
impl UiExt for Ui {
|
||||
fn inspect<T: Inspect>(&mut self, what: &T, id_source: &mut u64) {
|
||||
loop {}
|
||||
}
|
||||
fn inspect_iter_with<'a, I, T, F>(
|
||||
&mut self,
|
||||
title: &str,
|
||||
into_iter: I,
|
||||
id_source: &mut u64,
|
||||
mut fun: F,
|
||||
) where
|
||||
I: IntoIterator<Item = &'a T>,
|
||||
T: 'a,
|
||||
F: FnMut(&mut Ui, usize, &T, &mut u64),
|
||||
{
|
||||
loop {}
|
||||
}
|
||||
fn inspect_iter_with_mut<'a, I, T, F>(
|
||||
&mut self,
|
||||
title: &str,
|
||||
into_iter: I,
|
||||
id_source: &mut u64,
|
||||
mut fun: F,
|
||||
) where
|
||||
I: IntoIterator<Item = &'a mut T>,
|
||||
T: 'a,
|
||||
F: FnMut(&mut Ui, usize, &mut T, &mut u64),
|
||||
{
|
||||
loop {}
|
||||
}
|
||||
fn inspect_mut<T: Inspect>(&mut self, what: &mut T, id_source: &mut u64) {
|
||||
loop {}
|
||||
}
|
||||
fn property<T: Inspect>(&mut self, name: &str, what: &mut T, id_source: &mut u64) {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
impl Inspect for () {
|
||||
fn inspect(&self, ui: &mut Ui, _id_source: u64) {
|
||||
loop {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue