From f84c7d1627acbd54958b5fc3c3773f467e98e777 Mon Sep 17 00:00:00 2001 From: Evan Hemsley Date: Mon, 27 Jul 2020 14:11:08 -0700 Subject: [PATCH] make a note about multiple foreach blocks --- content/pong/ball/bouncing/motion_engine.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/content/pong/ball/bouncing/motion_engine.md b/content/pong/ball/bouncing/motion_engine.md index f4726a4..2a56404 100644 --- a/content/pong/ball/bouncing/motion_engine.md +++ b/content/pong/ball/bouncing/motion_engine.md @@ -107,6 +107,10 @@ Next, in a separate block, let's consolidate our MotionMessages per Entity. This is where our *IHasEntity* optimization comes in. It allows us to use the **ReadMessagesWithEntity** method. This method efficiently queries messages that refer to the given entity. +{{% notice note %}} +Up until now we have only used one **foreach** block in our Engines, but in this case it's better to split up the logic into multiple **foreach** blocks. Sometimes you will need to do this. +{{% /notice %}} + Finally, let's implement our sweep test. ```cs