mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Merge branch 'main' of https://github.com/antopilo/Nuake into main
This commit is contained in:
7
Nuake/BaseClass.h
Normal file
7
Nuake/BaseClass.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class BaseClass {
|
||||
public:
|
||||
std::string Name;
|
||||
};
|
||||
12
Nuake/BrushClass.h
Normal file
12
Nuake/BrushClass.h
Normal 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
15
Nuake/ClassProperty.h
Normal 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
11
Nuake/FDGSerializer.h
Normal 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
8
Nuake/FGDSerializer.cpp
Normal 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
6
Nuake/PointClass.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
#include "BaseClass.h"
|
||||
|
||||
class PointClass : public BaseClass {
|
||||
|
||||
};
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
Reference in New Issue
Block a user