<commit_before>//
//  Token.cpp
//  Phantasma
//
//  Created by <NAME> on 08/12/2013.
//  Copyright (c) 2013 <NAME>. All rights reserved.
//

#include "Token.h"

uint32_t Token::GetValue(CGameState *gameState, uint32_t suggestedValue)
{
	switch(type)
	{
		case CONSTANT:	return value;
		case VARIABLE:	return gameState->GetVariable(value);
		default:		return suggestedValue;
	}
}<commit_msg>Fleshed out implementation.<commit_after>//
//  Token.cpp
//  Phantasma
//
//  Created by <NAME> on 08/12/2013.
//  Copyright (c) 2013 <NAME>. All rights reserved.
//

#include "Token.h"

Token::Token(Type _type)
{
	type = _type;
}

Token::Token(std::string *_string)
{
	type = Token::STRINGLITERAL;
	string = _string;
}

Token::Token(Type _type, uint32_t _value)
{
	type = _type;
	value = _value;
}

Token::Type Token::getType()
{
	return type;
}

uint32_t Token::GetValue(CGameState *gameState, uint32_t suggestedValue)
{
	switch(type)
	{
		case CONSTANT:	return value;
		case VARIABLE:	return gameState->GetVariable(value);
		default:		return suggestedValue;
	}
}

Token::~Token()
{
	if(type == Token::STRINGLITERAL && string)
		delete string;
}
{'fraction_non_alphanumeric': 0.14925373134328357, 'fraction_numerical': 0.029850746268656716, 'mean_word_length': 4.066666666666666, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6291637', 'n_tokens_mistral': 462, 'n_tokens_neox': 429, 'n_words': 98}