Skip to main content

HlodSet

Struct HlodSet 

Source
pub struct HlodSet { /* private fields */ }
Expand description

Die Cluster-Menge mit Zustandsmaschine (siehe Modul-Doku).

Eine leere Menge ist der Normalzustand, solange kein Bake vorhanden ist: update liefert dann immer None und die Partition läuft exakt wie vor M3d.

Implementations§

Source§

impl HlodSet

Source

pub fn new(cfg: HlodConfig) -> Self

Source

pub fn config(&self) -> &HlodConfig

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn contains(&self, cell: HlodCell) -> bool

Source

pub fn cells(&self) -> Vec<HlodCell>

Alle registrierten Cluster, deterministisch sortiert nach (x, y) (für Abfragen und Agent-Antworten).

Source

pub fn register(&mut self, cell: HlodCell, source_cells: u32)

Cluster aus dem Bake eintragen; source_cells = Zahl der zusammengefassten Fein-Zellen. Erneutes Registrieren überschreibt nur die Zellzahl, nie den Sichtbarkeitszustand.

Source

pub fn unregister(&mut self, cell: HlodCell) -> Option<u32>

Cluster entfernen. War er sichtbar, meldet update kein hidden mehr für ihn — der Aufrufer blendet ihn selbst aus.

Source

pub fn source_cells(&self, cell: HlodCell) -> Option<u32>

Vom Backer zusammengefasste Fein-Zellen eines Clusters.

Source

pub fn is_shown(&self, cell: HlodCell) -> bool

Source

pub fn shown(&self) -> Vec<HlodCell>

Aktuell sichtbare Cluster, deterministisch nach (x, y) sortiert.

Source

pub fn update(&mut self, camera: Vec2) -> Option<HlodDelta>

Ein Frame: Übernahmezonen gegen die Kamera rechnen. Liefert None, wenn kein Cluster seinen Zustand wechselte.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.