Resets all players, and move dealer to the bottom of queue.

@param PlayerCollection $players

@return LeftToAct
162822
public function setupWithoutDealer(PlayerCollection $players): self
    {
        $collection = $this->setup($players);

        // move the dealer to last
        $collection = $collection->movePlayerToLastInQueue();

        return self::make($collection->values()->toArray());
    }
363514
public function save(Player $player)
    {
        if (self::playerExists($player->get('steamid'))) {
            $this->update($player);
        } else {
            $this->insert($player);
        }
    }
172957
public function removeItems( $items ) {
		foreach ( $items as $item ) {
			$index = array_search( $item, $this->items, true );
			if ( $index !== false ) {
				$item->setElementGroup( null );
				array_splice( $this->items, $index, 1 );
			}
		}

		// Update actual target element contents to reflect our list
		$this->group->clearContent();
		$this->group->appendContent( $this->items );

		return $this;
	}
1187009
public function prune($player = null)
    {
        if ($player) {
            $this->addUsingAlias(PlayerTableMap::COL_ID, $player->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }
299844
public function onPlayerChat(Player $player, $text)
    {
        if ($player->getPlayerId() === 0) {
            return;
        }
        if (substr($text, 0, 1) == "/") {
            return;
        }

        if ($text == "++") {
            $this->setVote($player->getLogin(), 100);
        }

        if ($text == "--") {
            $this->setVote($player->getLogin(), 0);
        }

    }
1013412
public function removeUsers($users)
    {
        if (is_array($users)) {
            foreach ($users as $id) {
                $this->users()->detach($id);
            }

            return $this;
        }

        $this->users()->detach($users);

        return $this;
    }
797695
public function setItems($items)
    {
        foreach ($items as $item) {
            $item->setGallery($this);
        }
        $this->items = $items;

        return $this;
    }
545777
public function removeUsers(ArrayCollection $users)
    {
        foreach ($users as $user) {
            $user->removeTeam($this);
            $this->users->removeElement($user);
        }
    }
904004
public synchronized void clearPlaybackState(int player) {
        PlaybackState oldFurthestState = getFurthestPlaybackState();
        PlaybackState oldState = playbackStateMap.remove(player);
        repaintDueToPlaybackStateChange(oldState, null, oldFurthestState);
    }
286192
public function move($player, $move)
    {
        $this->checkPlayer($player);
        $this->checkMove($move);

        // Take seeds in hand
        $hand = $this->grid[$player]['seeds'][$move];
        $this->grid[$player]['seeds'][$move] = 0;

        $row = $player;
        $box = $move;

        /**
         * Dispatch seeds
         */
        while ($hand > 0) {
            if (0 === $row) {
                if (0 === $box) {
                    $row = 1;
                } else {
                    $box--;
                }
            } else {
                if (5 === $box) {
                    $row = 0;
                } else {
                    $box++;
                }
            }

            // Feed box
            if (($row !== $player) || ($box !== $move)) {
                $hand--;
                $this->grid[$row]['seeds'][$box]++;
            }
        }

        /**
         * Anti starve check
         */
        if ((0 === $row && 0 === $box) || (1 === $row && 5 === $box)) {
            if (($row !== $player) && self::allSeedsVulnerable($this->grid[$row]['seeds'])) {
                return $this;
            }
        }

        /**
         * Store opponent seeds
         */
        while (($row !== $player) && in_array($this->grid[$row]['seeds'][$box], array(2, 3))) {
            // Store his seeds
            $this->grid[$player]['attic'] += $this->grid[$row]['seeds'][$box];
            $this->grid[$row]['seeds'][$box] = 0;

            // Check previous box
            if (0 === $row) {
                if (5 === $box) {
                    $row = 1;
                } else {
                    $box++;
                }
            } else {
                if (0 === $box) {
                    $row = 0;
                } else {
                    $box--;
                }
            }
        }

        return $this;
    }
151853
public function setItems($items)
    {
        if ($items && !$items instanceof ItemBag) {
            $items = new MulticardsItemBag($items);
        }

        return $this->setParameter('items', $items);
    }
1308862
public function giveButtonToPlayer(PlayerContract $player)
    {
        $playerIndex = $this->playersSatDown()
            ->filter
            ->equals($player)
            ->keys()
            ->first();

        if ($playerIndex === null) {
            throw TableException::invalidButtonPosition();
        }

        $this->button = $playerIndex;
    }
745177
public function playerCalls(PlayerContract $player)
    {
        $this->checkPlayerTryingToAct($player);

        $highestChipBet = $this->highestBet();

        // current highest bet - currentPlayersChipStack
        $amountLeftToBet = Chips::fromAmount($highestChipBet->amount() - $this->playerBetStack($player)->amount());

        $chipStackLeft = Chips::fromAmount($player->chipStack()->amount() - $amountLeftToBet->amount());

        if ($chipStackLeft->amount() <= 0) {
            $amountLeftToBet = Chips::fromAmount($player->chipStack()->amount());
            $chipStackLeft = Chips::zero();
        }

        $action = $chipStackLeft->amount() === 0 ? Action::ALLIN : Action::CALL;
        $this->actions->push(new Action($player, $action, ['chips' => $amountLeftToBet]));

        $this->placeChipBet($player, $amountLeftToBet);

        $action = $chipStackLeft->amount() === 0 ? LeftToAct::ALLIN : LeftToAct::ACTIONED;
        $this->leftToAct = $this->leftToAct()->playerHasActioned($player, $action);
    }
1042486
private function resetBetStacks()
    {
        $this->players()->each(function (PlayerContract $player) {
            $this->betStacks->put($player->name(), Chips::zero());
        });
    }
1033618
public function order($items)
	{
		$this->emptyResult();

		empty($items) ? $this->queryBuilder->order(NULL) : $this->queryBuilder->addOrder(func_get_args());
		return $this;
	}
289384
public function play($player, $move)
    {
        if (!$this->isPlayerTurn($player)) {
            throw new AwaleException('Not your turn.');
        }

        if (0 === $this->grid[$player]['seeds'][$move]) {
            throw new AwaleException('This container is empty.');
        }

        $this->checkMustFeedOpponentRule($player, $move);

        $this
            ->move($player, $move)
            ->setLastMove(array(
                'player' => $player,
                'move' => $move,
            ))
            ->changePlayerTurn()
        ;

        if (!$this->hasSeeds(1 - $this->currentPlayer) && !$this->canFeedOpponent($this->currentPlayer)) {
            $this->storeRemainingSeeds($this->currentPlayer);
        }

        return $this;
    }
411429
public function onPlayerInfoChanged(Player $oldPlayer, Player $player)
    {
        unset($this->players[$player->getLogin()]);
        unset($this->spectators[$player->getLogin()]);

        $this->onPlayerConnect($player);
    }