<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1556/">https://reviewboard.asterisk.org/r/1556/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I&#39;m going to go ahead and point out that I do have a slight issue with the way we handled this, but that it&#39;s forgivable since that&#39;s how the game was already working... but basically, every time we want a type of blip to do something, we are iterating through every blip to perform those actions.  This is rather awkward, because this means that our performance takes a significant hit with each new object added.  Really, the various actions taken by objects in this game should have been handled more like this:

//main game loop
AST_LIST_TRAVERSE(...) { //traversing all the blips as &#39;cur&#39; 
    switch(cur-&gt;type) {
        case BLIP_ALIEN:
            alien_action(cur);
            break;
        
        case BLIP_SHOT:
            shot_action(cur);
            break;
        //and then another case for each of the various object types that act every turn
    }
}

So yeah, you get the idea... we could basically just save a lot of iteration and only have to go through the list once.

Even better, we could maintain specific lists of individual object types and iterate through them individually, which would have been nice since there are a lot of times where we need to iterate through the objects, but we are really only looking for something like the aliens or the shots or the bombs or the barriers, but not all of them.  These are all just things to think about as optimization problems.  We are really doing a lot of unnecessary work here with the excessive nested list traversals.</pre>
 <br />







<p>- jrose</p>


<br />
<p>On November 2nd, 2011, 1:26 p.m., jrose wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers, David Vossel and jrose.</div>
<div>By jrose.</div>


<p style="color: grey;"><i>Updated Nov. 2, 2011, 1:26 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Adds barriers to the cmenuselect easteregg.  They absorb shots, but fall apart quickly.  Also has support for different amounts of health on barriers, but this is currently set to one shot, one barrier killed.

Submitted by proxy for J&#39;Len Dowdy.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Played through the easteregg a number of times to make sure it didn&#39;t explode under normal use conditions.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://issues.asterisk.org/jira/browse/ASTERISK-18802">ASTERISK-18802</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/menuselect_curses.c <span style="color: grey">(953)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1556/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>