Remove lcf::Data
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -34,7 +34,6 @@ set(CMAKE_CXX_EXTENSIONS ON)
add_library(lcf)
set(LCF_SOURCES
- src/data.cpp
src/dbarray.cpp
src/encoder.cpp
src/ini.cpp
@@ -194,7 +193,6 @@ set(LCF_SOURCES
set(LCF_HEADERS
src/lcf/context.h
- src/lcf/data.h
src/lcf/dbarray.h
src/lcf/dbarrayalloc.h
src/lcf/dbbitarray.h

MODIFY
Makefile.am
Makefile.am
@@ -42,7 +42,6 @@ liblcf_la_LDFLAGS = \
$(AM_LDFLAGS) \
-no-undefined
liblcf_la_SOURCES = \
- src/data.cpp \
src/dbarray.cpp \
src/encoder.cpp \
src/ini.cpp \
@@ -201,7 +200,6 @@ liblcf_la_SOURCES = \
lcfinclude_HEADERS = \
src/lcf/context.h \
- src/lcf/data.h \
src/lcf/dbarray.h \
src/lcf/dbarrayalloc.h \
src/lcf/dbbitarray.h \

MODIFY
configure.ac
configure.ac
@@ -10,7 +10,7 @@ AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
AC_CONFIG_MACRO_DIR([builds/autoconf/m4])
-AC_CONFIG_SRCDIR([src/data.cpp])
+AC_CONFIG_SRCDIR([src/ldb_reader.cpp])
AC_LANG([C++])
# Checks for programs.

DELETE
src/data.cpp
-/*
- * This file is part of liblcf. Copyright (c) 2020 liblcf authors.
- * https://github.com/EasyRPG/liblcf - https://easyrpg.org
- *
- * liblcf is Free/Libre Open Source Software, released under the MIT License.
- * For the full copyright and license information, please view the COPYING
- * file that was distributed with this source code.
- */
-
-#include "lcf/rpg/database.h"
-#include "lcf/data.h"
-
-namespace lcf {
-
-namespace Data {
- rpg::Database data;
-
- std::vector<rpg::Actor>& actors = data.actors;
- std::vector<rpg::Skill>& skills = data.skills;
- std::vector<rpg::Item>& items = data.items;
- std::vector<rpg::Enemy>& enemies = data.enemies;
- std::vector<rpg::Troop>& troops = data.troops;
- std::vector<rpg::Terrain>& terrains = data.terrains;
- std::vector<rpg::Attribute>& attributes = data.attributes;
- std::vector<rpg::State>& states = data.states;
- std::vector<rpg::Animation>& animations = data.animations;
- std::vector<rpg::Chipset>& chipsets = data.chipsets;
- std::vector<rpg::CommonEvent>& commonevents = data.commonevents;
- rpg::BattleCommands& battlecommands = data.battlecommands;
- std::vector<rpg::Class>& classes = data.classes;
- std::vector<rpg::BattlerAnimation>& battleranimations = data.battleranimations;
- rpg::Terms& terms = data.terms;
- rpg::System& system = data.system;
- std::vector<rpg::Switch>& switches = data.switches;
- std::vector<rpg::Variable>& variables = data.variables;
-
- rpg::TreeMap treemap;
-}
-
-void Data::Clear() {
- actors.clear();
- skills.clear();
- items.clear();
- enemies.clear();
- troops.clear();
- terrains.clear();
- attributes.clear();
- states.clear();
- animations.clear();
- chipsets.clear();
- commonevents.clear();
- battlecommands = rpg::BattleCommands();
- classes.clear();
- battleranimations.clear();
- terms = rpg::Terms();
- system = rpg::System();
- switches.clear();
- variables.clear();
- treemap.active_node = 0;
- treemap.maps.clear();
- treemap.tree_order.clear();
-}
-
-} //namespace lcf

DELETE
src/lcf/data.h
-/*
- * This file is part of liblcf. Copyright (c) 2020 liblcf authors.
- * https://github.com/EasyRPG/liblcf - https://easyrpg.org
- *
- * liblcf is Free/Libre Open Source Software, released under the MIT License.
- * For the full copyright and license information, please view the COPYING
- * file that was distributed with this source code.
- */
-
-#ifndef LCF_DATA_H
-#define LCF_DATA_H
-
-#include <string>
-#include <vector>
-#include "lcf/rpg/actor.h"
-#include "lcf/rpg/skill.h"
-#include "lcf/rpg/item.h"
-#include "lcf/rpg/enemy.h"
-#include "lcf/rpg/troop.h"
-#include "lcf/rpg/attribute.h"
-#include "lcf/rpg/state.h"
-#include "lcf/rpg/terrain.h"
-#include "lcf/rpg/animation.h"
-#include "lcf/rpg/chipset.h"
-#include "lcf/rpg/terms.h"
-#include "lcf/rpg/system.h"
-#include "lcf/rpg/commonevent.h"
-#include "lcf/rpg/class.h"
-#include "lcf/rpg/battlecommand.h"
-#include "lcf/rpg/battleranimation.h"
-#include "lcf/rpg/sound.h"
-#include "lcf/rpg/music.h"
-#include "lcf/rpg/eventcommand.h"
-#include "lcf/rpg/treemap.h"
-#include "lcf/rpg/database.h"
-
-namespace lcf {
-
-/**
- * Data namespace
- */
-namespace Data {
- /** Database Data (ldb) */
- extern rpg::Database data;
- /** @{ */
- extern std::vector<rpg::Actor>& actors;
- extern std::vector<rpg::Skill>& skills;
- extern std::vector<rpg::Item>& items;
- extern std::vector<rpg::Enemy>& enemies;
- extern std::vector<rpg::Troop>& troops;
- extern std::vector<rpg::Terrain>& terrains;
- extern std::vector<rpg::Attribute>& attributes;
- extern std::vector<rpg::State>& states;
- extern std::vector<rpg::Animation>& animations;
- extern std::vector<rpg::Chipset>& chipsets;
- extern std::vector<rpg::CommonEvent>& commonevents;
- extern rpg::BattleCommands& battlecommands;
- extern std::vector<rpg::Class>& classes;
- extern std::vector<rpg::BattlerAnimation>& battleranimations;
- extern rpg::Terms& terms;
- extern rpg::System& system;
- extern std::vector<rpg::Switch>& switches;
- extern std::vector<rpg::Variable>& variables;
- /** @} */
-
- /** TreeMap (lmt) */
- extern rpg::TreeMap treemap;
-
- /**
- * Clears database data.
- */
- void Clear();
-}
-
-} //namespace lcf
-
-#endif

Remove lcf::Data