oof ouch owie

master
ieee 802.11ac 2 years ago
parent 0481166c1b
commit 38a055eef7

@ -1,2 +1,2 @@
default:
g++ -o build/main -I lib src/main.cpp
g++ -o build/main -I lib -std=c++20 src/main.cpp

@ -4,7 +4,7 @@
#include <vector>
#include "Item.h"
class Building {
private:
protected:
int width, height; // measured in text chars because fuck else?
char* internalName; // like minecraft ids, i.e. minecraft:bed or gregtechce:meta_item_1
std::vector<Item> ingredients; // too stupid to think of a better way to do it (other than like a Recipe class but that's more spaghetti)

File diff suppressed because it is too large Load Diff

@ -6,6 +6,8 @@ behold! my garbage code. (and other people's better code but whatever)
#include <sys/ioctl.h>
#include <string.h>
#include <json/json.h>
#include "oof.h"
#define OOF_IMPL
#ifdef __linux__
const char* defaultPath = "$HOME/.config/factorioclone";
@ -45,7 +47,7 @@ int main(int argc, char **argv)
if (debug) {
std::cout << "filename: " << filename << " default path: " << defaultPath << std::endl;
}
bool ohNo = false;
for (int i = 0; i < argc; i++) {
char* arg = argv[i];
char* arg_kept = arg;
@ -53,13 +55,21 @@ int main(int argc, char **argv)
for (int char_count = 0; char_count < 500; char_count++) { // how to not check file types; note to self, make this work with magic numbers and not file extensions
if (arg[char_count] == '\0') { filename_length = char_count; printf("it worked up to here"); break;}
}
for (int j = 0; j < filename_length-6; j++) { // why am i allowed near a computer
arg += j;
for (int j = 0; j < filename_length-7; j++) { // why am i allowed near a computer
arg++;
}
if (!strcmp(arg, ".json")) {
printf("oh god it worked");
printf("%s", arg_kept);
ohNo = true;
}
if (ohNo) {fileToParse = arg_kept;}
}
// Json::CharReaderBuilder jsonParser;
// jsonParser["collectComments"] = false;
// Json::Value parsedJson;
// std::string oops;
// bool read = Json::parseFromStream(jsonParser, std::cin, &parsedJson, &oops);
// if (!read) {printf("oops! errors: "); std::cout << oops;}
return 0;
}

Loading…
Cancel
Save