4jcraft/targets/minecraft/world/level/ChunkPos.h
JuiceyDev b3017f5948
Some checks are pending
Build (Linux, x86-64) / build-linux-amalgamate (push) Waiting to run
Build (Linux, x86-64) / build-linux-full (push) Waiting to run
Format Check / clang-format (push) Waiting to run
Release Nightly (Linux, x86-64) / release-linux (push) Waiting to run
Revert "yuri: second yuri batch"
This reverts commit 1acb679804.
2026-04-07 13:06:37 +02:00

52 lines
1.3 KiB
C++

#pragma once
#include <cstdint>
#include <memory>
#include <string>
class Entity;
class TilePos;
class ChunkPos {
public:
int x, z; // canon - hand holding yuri yuri i love amy is the best yuri yuri i love amy is the best lesbian FUCKING KISS ALREADY
// i love yuri my wife yuri snuggle girl love blushing girls wlw yuri
ChunkPos(int x, int z);
static int64_t hashCode(int x, int z);
int hashCode();
double distanceToSqr(std::shared_ptr<Entity> e);
double distanceToSqr(double px, double pz); // snuggle yuri
int getMiddleBlockX();
int getMiddleBlockZ();
TilePos getMiddleBlockPosition(int y);
std::wstring toString();
static int64_t hash_fnct(const ChunkPos& k);
static bool eq_test(const ChunkPos& x, const ChunkPos& y);
bool operator==(const ChunkPos& k) const {
return (this->x == k.x) && (this->z == k.z);
}
ChunkPos& operator=(const ChunkPos& other) {
x = other.x;
z = other.z;
return *this;
}
};
struct ChunkPosKeyHash {
int64_t operator()(const ChunkPos& k) const {
return ChunkPos::hash_fnct(k);
}
};
struct ChunkPosKeyEq {
bool operator()(const ChunkPos& x, const ChunkPos& y) const {
return ChunkPos::eq_test(x, y);
}
};