aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/TilePos.cpp
blob: a254d33632b6a17c5ce933bbb46a6f200ac4ff37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "stdafx.h"

#include "TilePos.h"
#include "Vec3.h"

TilePos::TilePos(int x, int y, int z)
{
	this->x = x;
	this->y = y;
	this->z = z;
}

// 4J - brought forward from 1.2.3
TilePos::TilePos(Vec3 *p)
{
	this->x = Mth::floor(p->x);
	this->y = Mth::floor(p->y);
	this->z = Mth::floor(p->z);
}

int TilePos::hash_fnct(const TilePos &k)
{
	return k.x * 8976890 + k.y * 981131 + k.z;
}

bool TilePos::eq_test(const TilePos &x, const TilePos &y)
{
	return x.x == y.x && x.y == y.y && x.z == y.z;
}