From fe366e298531ee59f496aa99017428882b6be40e Mon Sep 17 00:00:00 2001 From: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com> Date: Mon, 28 Oct 2024 21:03:40 +0100 Subject: [PATCH] Update world api.md --- docs/world api.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/world api.md b/docs/world api.md index af41ff046d..16f0ca35f7 100644 --- a/docs/world api.md +++ b/docs/world api.md @@ -755,9 +755,9 @@ and check whether they were **unlocked**. and check whether they **became locked**. Another impactful way to optimise LogicMixin is to use caching. -Your custom state variables don't actually need to be recalculated on every collect / remove, because there are often -multiple calls to `collect` / `remove` between access rule calls. Thus, it would be much more efficient to hold off -on recaculating until the an actual access rule call happens. +Your custom state variables don't actually need to be recalculated on every `collect` / `remove`, because there are +often multiple calls to `collect` / `remove` between access rule calls. Thus, it would be much more efficient to hold +off on recaculating until the an actual access rule call happens. A common way to realize this is to define a `mygame_state_is_stale` variable that is set to True in `collect`, `remove`, and `init_mixin`. The calls to the actual recalculating functions are then moved to the start of the relevant access rules like this: