<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>lord_hollow</author_name>
  <author_url>https://blog.hatena.ne.jp/lord_hollow/</author_url>
  <blog_title>虚飾の王</blog_title>
  <blog_url>https://lord-hollow.hatenadiary.org/</blog_url>
  <categories>
    <anon>PC</anon>
    <anon>C</anon>
  </categories>
  <description>弾のオブジェクトが大量にあって、移動した結果画面から消えてなくなるという処理を考える。 段幕処理に限らず、リストのすべてを処理してその結果によってリストからなくなるというのはよくある話で。 素直に //List&lt;Bullet&gt; bullets; foreach(Bullet b in this.bullets) { b.Act(); if(!b.Alive) this.bullets.Remove(b); } と書いてみたいところですが、foreachの中でリストのメンバを入れたり出したりするのは御法度です。 ここはちょこっと頭をひねって this.bullets.RemoveAll(dele…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Flord-hollow.hatenadiary.org%2Fentry%2F20080128%2Fp1&quot; title=&quot;C#::foreachしながらRemove - 虚飾の王&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-01-28 00:00:01</published>
  <title>C#::foreachしながらRemove</title>
  <type>rich</type>
  <url>https://lord-hollow.hatenadiary.org/entry/20080128/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
