mirror of
https://github.com/Motschen/Adventura.git
synced 2025-12-15 19:35:09 +01:00
Because of a weird task requirement, folders are not allowed
Who tf came up with this limitation? Seriously...
This commit is contained in:
46
block.hpp
Normal file
46
block.hpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
#include "identifier.hpp"
|
||||
#include "color.hpp"
|
||||
#include "blockSettings.hpp"
|
||||
|
||||
class Block {
|
||||
private:
|
||||
Identifier id = Identifier("adventure", "missing");
|
||||
char encoding;
|
||||
Color color;
|
||||
BlockSettings settings;
|
||||
|
||||
public:
|
||||
Block(Identifier id, char encoding, BlockSettings settings) : Block(id, encoding, Color::RESET, settings) {};
|
||||
Block(Identifier id, char encoding, Color color, BlockSettings settings) {
|
||||
this->id = id;
|
||||
this->encoding = encoding;
|
||||
this->color = color;
|
||||
this->settings = settings;
|
||||
};
|
||||
|
||||
BlockSettings getSettings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
Identifier getId() {
|
||||
return id;
|
||||
}
|
||||
Color getColor() {
|
||||
return color;
|
||||
}
|
||||
char getEncoding() {
|
||||
return encoding;
|
||||
}
|
||||
void setEncoding(char encoding) {
|
||||
this->encoding = encoding;
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out) {
|
||||
out << encoding;
|
||||
return out;
|
||||
}
|
||||
bool operator==(Block otherBlock) {
|
||||
return this->getId() == otherBlock.getId();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user