<commit_before>/*
 * Player.cpp
 *
 *  Created on: Nov 26, 2017
 *      Author: lowji
 */

#include "Player.h"
#include "Card.h"
#include "helper.h"
#include "Board.h"

Player::Player(string name){
	this->name=name;
}

void Player::addOne(Card temp){
	handOne=temp;
}

void Player::addTwo(Card temp){
	handTwo=temp;
}

int Player::getTotalChips(){
	return totalChips;
}

string Player::getName(){
	return name;
}

Card Player::getHandOne(){
	return handOne;
}

Card Player::getHandTwo(){
	return handTwo;
}

int Player::getTempPool(){
	return tempBetPool;
}
int Player::getPrevBet()
{
	return prevBet;
}
void Player::setPrevBet(int num)
{
	prevBet = num;
}
void Player::setTotalChips(int chips){
	totalChips=chips;
}

void Player::setTempPool(int bet){
	tempBetPool=bet;
}

void Player::resetTempPool(){
	tempBetPool=0;
}

void Player::raise(int newBet){
	setTempPool(tempBetPool + newBet);
	setTotalChips(totalChips-newBet);
}

void Player::blind(int bet){
  tempBetPool = bet;
}

void Player::call(Player* opp){
	int change = opp->getTempPool()-tempBetPool;
	tempBetPool = opp->getTempPool();
	setTotalChips(totalChips-change);
}

//only for AI
void Player::decision(int pot, int sb, Player * hum){
	string inputTemp;
	helper* help=new helper();
	help->setStrengthChart();
	int strength=help->getStrength(&handOne,&handTwo);
	switch(strength){
	case 4:
		this->raise(pot);
		break;
	case 3:
		this->raise(pot*2/3/sb*sb);
		break;
	case 2:
		this->raise(pot/3/sb*sb);
		break;
	case 1:
		this->call(hum);
		break;
	case 0:
		this->call(hum);
		break;
	}
}<commit_msg>add AI behavior print out<commit_after>/*
 * Player.cpp
 *
 *  Created on: Nov 26, 2017
 *      Author: lowji
 */

#include "Player.h"
#include "Card.h"
#include "helper.h"
#include "Board.h"
#include "ConsoleUI.h"
Player::Player(string name){
	this->name=name;
}

void Player::addOne(Card temp){
	handOne=temp;
}

void Player::addTwo(Card temp){
	handTwo=temp;
}

int Player::getTotalChips(){
	return totalChips;
}

string Player::getName(){
	return name;
}

Card Player::getHandOne(){
	return handOne;
}

Card Player::getHandTwo(){
	return handTwo;
}

int Player::getTempPool(){
	return tempBetPool;
}
int Player::getPrevBet()
{
	return prevBet;
}
void Player::setPrevBet(int num)
{
	prevBet = num;
}
void Player::setTotalChips(int chips){
	totalChips=chips;
}

void Player::setTempPool(int bet){
	tempBetPool=bet;
}

void Player::resetTempPool(){
	tempBetPool=0;
}

void Player::raise(int newBet){
	setTempPool(tempBetPool + newBet);
	setTotalChips(totalChips-newBet);
}

void Player::blind(int bet){
  tempBetPool = bet;
}

void Player::call(Player* opp){
	int change = opp->getTempPool()-tempBetPool;
	tempBetPool = opp->getTempPool();
	setTotalChips(totalChips-change);
}

//only for AI
void Player::decision(int pot, int sb, Player * hum){
	string inputTemp;
	helper* help=new helper();
	ConsoleUI* ui = new ConsoleUI();
	help->setStrengthChart();
	int strength=help->getStrength(&handOne,&handTwo);
	switch(strength){
	case 4:
		this->raise(pot);
		ui->output("AI raised $" + to_string(pot));
		break;
	case 3:
		this->raise(pot*2/3/sb*sb);
		ui->output("AI raised $"+to_string(pot*2/3/sb*sb));
		break;
	case 2:
		this->raise(pot/3/sb*sb);
		ui->output("AI raised $"+to_string(pot/3/sb*sb));
		break;
	case 1:
		this->call(hum);
		ui->output("AI called.");
		break;
	case 0:
		this->call(hum);
		ui->output("AI called.");
		break;
	}
}
{'fraction_non_alphanumeric': 0.167936694021102, 'fraction_numerical': 0.009671746776084409, 'mean_word_length': 4.998242530755712, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '439890', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1309, 'n_words': 277}