Initial commit
This commit is contained in:
commit
4f4397b3e1
48 changed files with 2002 additions and 0 deletions
45
NimGame/game/Foo.h
Normal file
45
NimGame/game/Foo.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// Created by JoachimWagner on 11.03.2025.
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include <ostream>
|
||||
|
||||
class Punkt {
|
||||
private:
|
||||
int x{0};
|
||||
int y{0};
|
||||
|
||||
public:
|
||||
int getX() const {
|
||||
return x;
|
||||
}
|
||||
|
||||
void setX(int x) {
|
||||
Punkt::x = x;
|
||||
}
|
||||
|
||||
int getY() const {
|
||||
return y;
|
||||
}
|
||||
|
||||
void setY(int y) {
|
||||
Punkt::y = y;
|
||||
}
|
||||
|
||||
bool operator==(const Punkt &rhs) const {
|
||||
return x == rhs.x &&
|
||||
y == rhs.y;
|
||||
}
|
||||
|
||||
bool operator!=(const Punkt &rhs) const {
|
||||
return !(rhs == *this);
|
||||
}
|
||||
|
||||
friend std::ostream &operator<<(std::ostream &os, const Punkt &punkt) {
|
||||
os << "x: " << punkt.x << " y: " << punkt.y;
|
||||
return os;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue