Created
June 2, 2013 09:27
-
-
Save hfuller/5693133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function generate() { | |
$rs = $RANKS; $ts = $TYPES; | |
shuffle($rs) and shuffle($ts) or die("Failed to shuffle stuff"); | |
$rsi = 0; //ranks index | |
$tsi = 0; //types index | |
for ( $i = 0; $i < $SIZE; $i++ ) { | |
if ( $i < $SIDE /*or we are on the left or right side*/) { | |
$this->getHex($i)->setType(Hex::Water); | |
} else { | |
$this->getHex($i)->setType($ts[$tsi]); | |
$tsi++; | |
$this->getHex($i)->setRank($rs[$rsi]); | |
$rsi++; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment