forked from Kolyah35/minecraft-pe-0.6.1
the whole game
This commit is contained in:
44
src/world/level/TilePos.h
Executable file
44
src/world/level/TilePos.h
Executable file
@@ -0,0 +1,44 @@
|
||||
#ifndef NET_MINECRAFT_WORLD_LEVEL__TilePos_H__
|
||||
#define NET_MINECRAFT_WORLD_LEVEL__TilePos_H__
|
||||
|
||||
//package net.minecraft.world.level;
|
||||
|
||||
class TilePos
|
||||
{
|
||||
public:
|
||||
int x, y, z;
|
||||
|
||||
TilePos(int x_, int y_, int z_)
|
||||
: x(x_),
|
||||
y(y_),
|
||||
z(z_)
|
||||
{
|
||||
}
|
||||
|
||||
TilePos(const TilePos& rhs)
|
||||
: x(rhs.x),
|
||||
y(rhs.y),
|
||||
z(rhs.z)
|
||||
{}
|
||||
|
||||
bool operator<(const TilePos& rhs) const {
|
||||
return hashCode() < rhs.hashCode();
|
||||
}
|
||||
|
||||
TilePos& operator=(const TilePos& rhs) {
|
||||
x = rhs.x;
|
||||
y = rhs.y;
|
||||
z = rhs.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const TilePos& rhs) const {
|
||||
return x == rhs.x && y == rhs.y && z == rhs.z;
|
||||
}
|
||||
|
||||
int hashCode() const {
|
||||
return x * 8976890 + y * 981131 + z;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*NET_MINECRAFT_WORLD_LEVEL__TilePos_H__*/
|
||||
Reference in New Issue
Block a user