Merge branch 'main' of https://github.com/antopilo/Nuake into main

This commit is contained in:
Antoine Pilote
2021-06-19 15:53:15 -04:00
8 changed files with 84 additions and 3 deletions

7
Nuake/BaseClass.h Normal file
View File

@@ -0,0 +1,7 @@
#pragma once
#include <string>
class BaseClass {
public:
std::string Name;
};

12
Nuake/BrushClass.h Normal file
View File

@@ -0,0 +1,12 @@
#pragma once
#include "BaseClass.h"
#include "ClassProperty.h"
#include <string>
#include <vector>
class BrushClass : public BaseClass {
std::string name;
std::vector<ClassProperty> Props;
std::string Description;
};

15
Nuake/ClassProperty.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include <string>
enum class ClassPropertyType {
AABB,
Float,
String,
DropDown,
Color,
Int
};
struct ClassProperty {
std::string name;
ClassPropertyType type;
};

11
Nuake/FDGSerializer.h Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
#include <string>
class FGDSerializer
{
public:
static bool BeginFGDFile(const std::string path);
static bool RegisterEntity();
static bool EndFGDFile();
};

8
Nuake/FGDSerializer.cpp Normal file
View File

@@ -0,0 +1,8 @@
#include "FDGSerializer.h"
#include <src\Core\FileSystem.h>
bool FGDSerializer::BeginFGDFile(const std::string path)
{
FileSystem::BeginWriteFile(path + ".fgd");
}

6
Nuake/PointClass.h Normal file
View File

@@ -0,0 +1,6 @@
#pragma once
#include "BaseClass.h"
class PointClass : public BaseClass {
};

View File

@@ -12,6 +12,7 @@
namespace fs = std::filesystem;
std::string FileDialog::OpenFile(const char* filter)
{
@@ -132,6 +133,24 @@ std::string FileSystem::ReadFile(const std::string& path, bool absolute)
return allFile;
}
std::ofstream FileSystem::fileWriter;
bool FileSystem::BeginWriteFile(const std::string path)
{
fileWriter = std::ofstream();
fileWriter.open("example.txt");
return false;
}
bool FileSystem::WriteLine(const std::string line)
{
fileWriter << line.c_str();
}
void FileSystem::EndWriteFile()
{
fileWriter.close();
}
Ref<Directory> FileSystem::GetFileTree()
{

View File

@@ -2,7 +2,8 @@
#include <string>
#include <filesystem>
#include "Core.h"
#include <iostream>
#include <fstream>
class FileDialog
{
public:
@@ -49,6 +50,8 @@ public:
static std::string ReadFile(const std::string& path, bool absolute = false);
static std::ofstream fileWriter;
static bool BeginWriteFile(const std::string path);
static bool WriteLine(const std::string line);
static void EndWriteFile();
};