diff options
| author | Kai Stevenson <kai@kaistevenson.com> | 2026-08-23 01:07:07 -0700 |
|---|---|---|
| committer | Kai Stevenson <kai@kaistevenson.com> | 2026-08-23 01:07:07 -0700 |
| commit | d6664b9b5a9a3aab500b547e4d7448a8bc4ad416 (patch) | |
| tree | 688d30258e1e3b06d038ab40ea9c3d3a561c6426 /src/sim/cell/cell.rs | |
| parent | 260d5b0056f1a7177bcc98316592811577a0a565 (diff) | |
allow entity damage
Diffstat (limited to 'src/sim/cell/cell.rs')
| -rw-r--r-- | src/sim/cell/cell.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/sim/cell/cell.rs b/src/sim/cell/cell.rs index be2cfad..5a9fc1f 100644 --- a/src/sim/cell/cell.rs +++ b/src/sim/cell/cell.rs @@ -8,8 +8,11 @@ pub struct Cell { } impl Cell { + // only update the cell if this matches the parity of the seqno const FLAG_PARITY: u8 = 0b0000_0001; - const FLAG_ENTITY: u8 = 0b0000_0010; + // is this cell owned by an entity? + const FLAG_ENTITY_INTEGRATED: u8 = 0b0000_0010; + // how close is the cell to settling? const MASK_SETTLED: u8 = 0b0001_1100; #[inline] @@ -31,15 +34,15 @@ impl Cell { } #[inline] - pub fn entity(self) -> bool { - (self.flags & Self::FLAG_ENTITY) == Self::FLAG_ENTITY + pub fn entity_integrated(self) -> bool { + (self.flags & Self::FLAG_ENTITY_INTEGRATED) == Self::FLAG_ENTITY_INTEGRATED } #[inline] - pub fn set_entity(&mut self, rb: bool) { - if rb { - self.flags |= Self::FLAG_ENTITY + pub fn set_entity_integrated(&mut self, entity_integrated: bool) { + if entity_integrated { + self.flags |= Self::FLAG_ENTITY_INTEGRATED } else { - self.flags &= !Self::FLAG_ENTITY + self.flags &= !Self::FLAG_ENTITY_INTEGRATED } } |
