You are viewing a single comment's thread from:

RE: Archipelago - Huge Refactor!

Thanks @helo!

Yes, the loop scans the board array, finds forts, scans a 1-tile grid around the fort, excludes diagonals, checks the tiles are on the board (since forts may be at the edge of the board), checks the tiles are sea, and if so creates a harbour protected by the fort!

There's a lot of this kind of looping in the code. Now that I have the Piece constructor I may think about ways to use the piece itself to find harbours on tiles next to it, which may be cleaner.

Thanks for the review.

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 59893.00
ETH 2414.92
USDT 1.00
SBD 2.43