<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, May 31, 2017 at 9:27 PM, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On 1 June 2017 at 08:12,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">james<br>
2017-05-31 13:12:35 -0700 (Wed, 31 May 2017)<br>
455<br>
the cats() array is now almost always accessed via helper functions<br>
herox() heroy() herox() and herodir()<br>
<br>
These are byref functions, so values can be assigned to them also.<br>
<br>
These functions take hero caterpillar rank as an argument,<br>
eliminating all the many places where catx(n * 5) was accessed.<br>
<br>
Also added herotx() and heroty() that replace all the many times<br>
when the x and y return values were immediately divided / 20 to get<br>
hero tile x and tile y<br>
---<br>
U   wip/game.bas<br>
U   wip/<a href="http://game.bi" rel="noreferrer" target="_blank">game.bi</a><br>
U   wip/<a href="http://game_udts.bi" rel="noreferrer" target="_blank">game_udts.bi</a><br>
U   wip/moresubs.rbas<br>
U   wip/savegame.rbas<br>
U   wip/scriptcommands.bas<br>
U   wip/walkabouts.bas<br>
U   wip/yetmore2.bas<br></blockquote><br></span>Altogether, adding that bitset was quite a big project! A lot of helpful cleanup.<br><div><br></div><div>This would be a good use for properties actually: turn hero{x,y,z,dir,tx,ty} into properties of herow. Then we will finally have a real hero walkabout UDT. (And can add XYpair versions, and allow assigning to tx/ty).<br></div></div></div></div></blockquote><div><br></div><div>I had actually considered making these methods of herow() but herow is an array of 4 HeroWalkabout objects, and (as far as I know) there is no way for an array member to be aware of what element of the array it is in (short of adding a .index member and keeping it updated whenever the array changes)<br><br></div><div>I didn't want to be writing herow(i).x(i) all over the place,especially since the first (i) in that would be effectively meaningless <br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Also, the tx, ty accessors are a great idea. I feel like supporting larger tile sizes isn't going to be such a huge project.<br></div></div><br></div></div></blockquote></div><br></div><div class="gmail_extra">Perhaps NPCInst could also use .tx() and .ty() helper methods that do the same thing<br></div><div class="gmail_extra"><br></div></div>