did some stuff

master
ieee 802.11ac 2 years ago
parent 806f223a30
commit c2b7626923

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

@ -0,0 +1,23 @@
#include "Building.h"
Building::Building(int unassignedW, int unassignedH, char* idToAssign, std::vector<ItemStack> ingredience) {
width = unassignedW;
height = unassignedH;
internalName = idToAssign;
ingredients = ingredience;
};
int Building::getHeight()
{
return height;
}
int Building::getWidth()
{
return width;
}
char* Building::getInternalName()
{
return internalName;
}
std::vector<ItemStack> Building::getIngredients()
{
return ingredients;
}

@ -1,10 +1,18 @@
#ifndef BUILDING_H
#define BUILDING_H
#include <vector>
#include "ItemStack.h"
class Building {
private:
int width, height; // measured in text chars because fuck else?
char* internalName; // like minecraft ids, i.e. minecraft:bed
std::vector<ItemStack> ingredients; // too stupid to think of a better way to do it (other than like a Recipe class but that's more spaghetti)
public:
Building(int, int, char*, std::vector<ItemStack>);
virtual ~Building();
int getWidth();
int getHeight();
char* getInternalName();
std::vector<ItemStack> getIngredients();
};
#endif

@ -0,0 +1,3 @@
/*
this'll be a part of the .json parser for worlds, unless someone wants to implement blotter v5 support
*/

@ -5,6 +5,8 @@ behold! my garbage code. (and other people's better code but whatever)
#include <sys/ioctl.h>
#include <string.h>
#include "Building.h"
std::string filename = "main";
int main(int argc, char **argv)
@ -24,6 +26,7 @@ int main(int argc, char **argv)
if (!strcmp(arg, "--help")) {
std::cout << "this is a factorio clone that runs in the terminal. it is shit. shoutouts to dragon lord for thinking up the name \"beaurocra-tech\"" << std::endl;
std::cout << "syntax: " << filename << " [arguments] <*.json>" << std::endl; // why json? because 1. it's convenient and 2. i'm too lazy to make a blotterv5 parser
break;
}
}

Loading…
Cancel
Save