private void nextEvent()
  {
    if (eventCount >= TOTAL_EVENTS)
    {
      state = BanditState.DONE;
      if (currentUser.isLogging())
      {
        game.log.sendByteBySocket(SocketToParallelPort.TRIGGER_BANDIT_DONE);
      }
    }
    else
    {
      eventCount++;

      if (winCount >= TOTAL_WIN)
      {
        state = BanditState.LOSE;
        loseCount++;
      }
      else if (loseCount >= TOTAL_LOSE)
      {
        state = BanditState.WIN;
        winCount++;
      }
      else if (score < LOW_SCORE_LIMIT)
      {
        state = BanditState.WIN;
        winCount++;
      }
      else if (Library.RANDOM.nextDouble() > winCount / (eventCount + 1.0))
      {
        state = BanditState.WIN;
        winCount++;
      }
      else
      {
        state = BanditState.LOSE;
        loseCount++;
      }

      if (state == BanditState.WIN)
      {
    	currentImage = winImage;
        if (currentUser.isLogging())
        {
          game.log.sendByteBySocket(SocketToParallelPort.TRIGGER_BANDIT_WIN);
        }
      }
      else
      {
    	currentImage = loseImage;
        if (currentUser.isLogging())
        {
          game.log.sendByteBySocket(SocketToParallelPort.TRIGGER_BANDIT_LOSE);
        }
      }
    }
  }