<commit_before>#include "File.h"
#include "Create.h"
#include "Create_Enums.h"
#include "Savable.h"

// Including files for use by factory
// Actors
#include "Objects\Player.h"
#include "GObjects\Rat.h"
#include "GObjects\Swordsmen.h"
// Maps
#include "GObjects\CenterTown.h"
// Objects
#include "GObjects\BasicSword.h"
#include "GObjects\HealingWand.h"
// Tiles
#include "GObjects\House_2Story.h"

Create::Create()
{
}


Create::~Create()
{
}

// Methods for new loading / saving system

Item* Create::loadNewItem() {
  // get id and create object with appropriate dynamic type
  File::Savable::idType id = File::Savable::nextID("Item");
  Item* item = Create::newItem(id);

  // load data from save
  item->load();

  return item;
}

Actor* Create::loadNewActor() {
  File::Savable::idType id = File::Savable::nextID("Actor");
  Actor* actor = Create::newActor(id);

  //TODO: actor->load();

  return actor;
}

Maps::Node* Create::loadNewNode() {
  using namespace File;
  using namespace Maps;

  Savable::idType id = Savable::nextID("Node");
  Node* node = Create::newNode(id);

  //TODO: node->load();

  return node;
}


Maps::Map* Create::loadNewMap() {
  using namespace File;
  using namespace Maps;

  Savable::idType id = Savable::nextID("Map");
  Map* map = Create::newMap(id);

  //TODO: map->load();
  return map;
}

Item* Create::newItem(int item) {
  Item* itemCreated = nullptr;
  switch (item) {
    case ITEM_BASIC_SWORD:
      itemCreated = new BasicSword{};
      break;
    case ITEM_HEALING_WAND:
      itemCreated = new HealingWand{};
      break;
    case ITEM_DEFAULT:
    default:
      itemCreated = new Item{};
      break;
  }
  itemCreated->setID(item);
  return itemCreated;
}

Actor* Create::newActor(int actor) {
  Actor* actorCreated = nullptr;
  switch (actor) {
    case ACTOR_PLAYER:
      // TODO: Proper singleton for player<commit_msg>Updated Create to load data<commit_after>#include "File.h"
#include "Create.h"
#include "Create_Enums.h"
#include "Savable.h"

// Including files for use by factory
// Actors
#include "Objects\Player.h"
#include "GObjects\Rat.h"
#include "GObjects\Swordsmen.h"
// Maps
#include "GObjects\CenterTown.h"
// Objects
#include "GObjects\BasicSword.h"
#include "GObjects\HealingWand.h"
// Tiles
#include "GObjects\House_2Story.h"

Create::Create()
{
}


Create::~Create()
{
}

// Methods for new loading / saving system

Item* Create::loadNewItem() {
  // get id and create object with appropriate dynamic type
  File::Savable::idType id = File::Savable::nextID("Item");
  Item* item = Create::newItem(id);

  // load data from save
  item->load();

  return item;
}

Actor* Create::loadNewActor() {
  File::Savable::idType id = File::Savable::nextID("Actor");
  Actor* actor = Create::newActor(id);

  actor->load();

  return actor;
}

Maps::Node* Create::loadNewNode() {
  using namespace File;
  using namespace Maps;

  Savable::idType id = Savable::nextID("Node");
  Node* node = Create::newNode(id);

  node->load();

  return node;
}


Maps::Map* Create::loadNewMap() {
  using namespace File;
  using namespace Maps;

  Savable::idType id = Savable::nextID("Map");
  Map* map = Create::newMap(id);

  map->load();
  return map;
}

Item* Create::newItem(int item) {
  Item* itemCreated = nullptr;
  switch (item) {
    case ITEM_BASIC_SWORD:
      itemCreated = new BasicSword{};
      break;
    case ITEM_HEALING_WAND:
      itemCreated = new HealingWand{};
      break;
    case ITEM_DEFAULT:
    default:
      itemCreated = new Item{};
      break;
  }
  itemCreated->setID(item);
  return itemCreated;
}

Actor* Create::newActor(int actor) {
  Actor* actorCreated = nullptr;
  switch (actor) {
    case ACTOR_PLAYER:
      // TODO: Proper singleton for player
{'fraction_non_alphanumeric': 0.14930555555555555, 'fraction_numerical': 0.0005341880341880342, 'mean_word_length': 3.8763020833333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3804499', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1284, 'n_words': 314}