mirror of
https://github.com/Motschen/Adventura.git
synced 2025-12-16 03:45:10 +01:00
Implement main logic
This commit is contained in:
38
src/block.hpp
Normal file
38
src/block.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
#include "identifier.hpp"
|
||||
#include "blockSettings.hpp"
|
||||
|
||||
class Block {
|
||||
private:
|
||||
Identifier id = Identifier("adventure", "missing");
|
||||
char encoding;
|
||||
BlockSettings settings;
|
||||
public:
|
||||
Block(Identifier id, char encoding, BlockSettings settings) {
|
||||
this->id = id;
|
||||
this->encoding = encoding;
|
||||
this->settings = settings;
|
||||
};
|
||||
|
||||
BlockSettings getSettings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
Identifier getId() {
|
||||
return id;
|
||||
}
|
||||
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