<commit_before>/******************************
** Tsunagari Tile Engine     **
** world.cpp                 **
** Copyright 2011 OmegaSDG   **
******************************/

#include <fstream>
#include <istream>

#include <json/json.h>

#include "log.h"
#include "world.h"

World::World(Resourcer* rc, const std::string descriptor)
	: rc(rc), descriptor(descriptor)
{
}

World::~World()
{
	if (player)
		delete player;
	if (area)
		delete area;
}

bool World::init()
{
	if (!processDescriptor()) // Try to load in descriptor.
		return false;

	// The player entity doesn't have a descriptor yet.
	player = new Entity(rc, "_NONE_", values.playersprite);
	if (!player->init())
		return false;
<commit_msg>initialize player, area in World constructor<commit_after>/******************************
** Tsunagari Tile Engine     **
** world.cpp                 **
** Copyright 2011 OmegaSDG   **
******************************/

#include <fstream>
#include <istream>

#include <json/json.h>

#include "log.h"
#include "world.h"

World::World(Resourcer* rc, const std::string descriptor)
	: rc(rc), area(NULL), player(NULL), descriptor(descriptor)
{
}

World::~World()
{
	if (player)
		delete player;
	if (area)
		delete area;
}

bool World::init()
{
	if (!processDescriptor()) // Try to load in descriptor.
		return false;

	// The player entity doesn't have a descriptor yet.
	player = new Entity(rc, "_NONE_", values.playersprite);
	if (!player->init())
		return false;

{'fraction_non_alphanumeric': 0.22426721199727334, 'fraction_numerical': 0.0054533060668029995, 'mean_word_length': 4.205673758865248, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2702713', 'n_tokens_mistral': 483, 'n_tokens_neox': 464, 'n_words': 131}