);
}
+ let puos = PUOs_Simple_Modify;
+
if let Some((region, views)) = region_views {
dbgc!("creating occ");
xupdates.extend(
create_occultation(&mut gen.unique_gen(), &mut gs.max_z,
gplayers, gpieces, goccults, ipieces, ioccults,
to_recalculate, rot_checked,
- region, piece, views)?
+ region, piece, views, &puos)?
);
dbgc!("creating occ done", &xupdates);
}
(PieceUpdate {
wrc, log,
- ops: PUOs::Simple(PUO::Modify(())),
- },
- xupdates.into_unprepared(None))
+ ops: puos.into(),
+ }, xupdates.into_unprepared(None))
}
fn occultation_notify_hook(&self, piece: PieceId) -> UnpreparedUpdates {
dbgc!("ui op k entry", &opname, &xdata);
+ let puos = PUOs_Simple_Modify;
+
let (new_owner, xupdates, did) =
match (opname, xdata.owner.is_some())
{
gplayers, gpieces, goccults,
ipieces, ioccults,
to_recalculate, rot_checked,
- region, piece, views)?;
+ region, piece, views, &puos)?;
xupdates
}
};
(PieceUpdate {
wrc, log,
- ops: PUOs::Simple(PUO::Modify(())),
+ ops: puos.into(),
}, xupdates.into_unprepared(None))
}
region: Region,
occulter: PieceId,
views: OccultationViews,
+ // Caller must promise not to fail if we succeed, so that this
+ // update actually happens!
+ _puos_will_return: &PUOs_Simple_Modify,
) -> Vec<(PieceId, PieceUpdateOps)> {
{
let ogpc = gpieces.get(occulter).ok_or_else(
}
}
+
+#[allow(non_camel_case_types)]
+#[derive(Copy,Clone,Debug)]
+pub struct PUOs_Simple_Modify;
+impl From<PUOs_Simple_Modify> for PieceUpdateOps {
+ fn from(_: PUOs_Simple_Modify) -> Self { PUOs::Simple(PUO::Modify(())) }
+}
+
// ---------- for traansmission ----------
#[derive(Debug,Serialize)]