From 5b779a1aa8e59f63f26ee2fd5cec908bf5ce1159 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 4 Jan 2023 01:07:59 +0100 Subject: Added stub Json repository --- universe/src/JsonRepository.cpp | 49 +++++++++++++++++++++++++++++++++++++++++ universe/src/JsonRepository.h | 29 ++++++++++++++++++++++++ universe/src/universe.cpp | 8 +++++++ 3 files changed, 86 insertions(+) create mode 100644 universe/src/JsonRepository.cpp create mode 100644 universe/src/JsonRepository.h (limited to 'universe/src') diff --git a/universe/src/JsonRepository.cpp b/universe/src/JsonRepository.cpp new file mode 100644 index 0000000..ddbbfcf --- /dev/null +++ b/universe/src/JsonRepository.cpp @@ -0,0 +1,49 @@ +#include "JsonRepository.h" + +#include +#include + +#include +#include +#include + + +namespace kurator +{ +namespace universe +{ + + +JsonRepository::JsonRepository(const char*) +{ +} + + +ShipType +JsonRepository::ship_type(const std::string& id) const +{ + throw NotFound(id); +} + + +TurretType +JsonRepository::turret_type(const std::string& id) const +{ + throw NotFound(id); +} + + +void +JsonRepository::for_ship_types(std::function) const +{ +} + + +void +JsonRepository::for_turret_types(std::function) const +{ +} + + +} // namespace universe +} // namespace kurator diff --git a/universe/src/JsonRepository.h b/universe/src/JsonRepository.h new file mode 100644 index 0000000..dc6e7f1 --- /dev/null +++ b/universe/src/JsonRepository.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include + +#include +#include +#include + + +namespace kurator +{ +namespace universe +{ + + +class JsonRepository : public Repository +{ +public: + explicit JsonRepository(const char* path); + ShipType ship_type(const std::string& id) const override; + TurretType turret_type(const std::string& id) const override; + void for_ship_types(std::function func) const; + void for_turret_types(std::function func) const; +}; + + +} // namespace universe +} // namespace kurator diff --git a/universe/src/universe.cpp b/universe/src/universe.cpp index b77ce7c..649b553 100644 --- a/universe/src/universe.cpp +++ b/universe/src/universe.cpp @@ -4,6 +4,7 @@ #include +#include "JsonRepository.h" #include "SampleRepository.h" @@ -14,6 +15,13 @@ namespace universe std::shared_ptr +load_json(const char* path) +{ + return std::make_shared(path); +} + + +std::shared_ptr load_sample() { return std::make_shared(); -- cgit v1.1