Skip to main content

WorldGrid

Struct WorldGrid 

Source
pub struct WorldGrid {
    pub zones: [WorldAtom; 41],
}
Expand description

The complete world grid — 41 zones.

Fields§

§zones: [WorldAtom; 41]

Implementations§

Source§

impl WorldGrid

Source

pub fn new() -> Self

Create a new world grid with zones placed on orbital shells.

Source

pub fn apply_op(&mut self, zone_id: u32, op_id: u32) -> bool

Apply an operation to a zone. Returns true if the op was new.

Source

pub fn has_op(&self, zone_id: u32, op_id: u32) -> bool

Check if an op is active in a zone.

Source

pub fn op_count(&self, zone_id: u32) -> u32

Count active ops in a zone.

Source

pub fn active_ops(&self, zone_id: u32) -> Vec<u32>

Get all active op IDs for a zone as a vec.

Source

pub fn update_stability(&mut self, substrate_r: f32)

Update zone stability based on substrate coherence R.

Source

pub fn apply_shockwave(&mut self, bass_peak: f32)

Apply a bass shockwave — ripples outward, attenuating per shell.

Source

pub fn tick(&mut self, dt: f32)

Tick all zones — decay resonance toward base values.

Source

pub fn witness_flat(&self) -> Vec<f32>

Get the zone witness as a flat f32 array: [R, entropy, stability, topology] per zone. Total length = ZONE_COUNT * 4 = 164.

Source

pub fn zone_shell(zone_id: u32) -> u8

Get the shell that a zone belongs to.

Trait Implementations§

Source§

impl Default for WorldGrid

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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.