public function testRemovePlayer() { $this->table->addPlayer(new Player('Drunk Troublemaker')); $this->assertEquals(2, $this->table->getNumPlayers()); $this->table->removePlayer('Drunk Troublemaker'); $this->assertEquals(1, $this->table->getNumPlayers()); }
function setupPlayers(Table $table, $players, $bank) { $human = new Player($table, $bank, true); $table->addPlayer($human); for ($players; $players > 0; $players--) { $player = new Player($table, $bank); $table->addPlayer($player); } }
} function pots($table) { foreach ($table->pots as $i => $pot) { echo "<hr />\n"; foreach (array("size" => $pot->size, "limit" => $pot->limit, "contributors" => count(array_keys($pot->contribs))) as $k => $v) { echo "<h2>Pot " . (1 + $i) . " {$k} = {$v}</h2>\n"; } print_r($pot->contribs); } echo "<h1>" . count($table->pots) . " POTS</h1>"; echo "\n\n"; var_dump($table->pots); } $table = new Table(); $table->addPlayer("A"); $table->addPlayer("B"); $table->addPlayer("C"); $table->start(); $table->newHand(); $table->players["A"]->cash = 15; #$table->players["B"]->cash = 150; $table->allin($table->hotSeat()); $table->progressPhase(); $table->nextSeat(); $table->turnMsg(); $table->allin($table->hotSeat()); $table->progressPhase(); $table->nextSeat(); $table->turnMsg(); $table->allin($table->hotSeat());