path_.js
// Handles converting WorldPositions back and forth from heap indexes
Handles converting WorldPositions back and forth from heap indexes
Handles converting WorldPositions back and forth from heap indexes
function indexFromPos(pos) {
	var roomId = Math.floor(pos.xx / 50) * kWorldSize * 2 + Math.floor(pos.yy / 50);
	var roomIndex = reverseRooms[roomId];
	if (roomIndex === 0) {
		throw new Error('Honk');
	} else {
		roomIndex = reverseRooms[roomId];
	}
	return (roomIndex - 1) * 50 * 50 + pos.xx % 50 * 50 + pos.yy % 50;
}
function indexFromPos ( pos ) { var roomId = Math . floor ( pos . xx / 50 ) * kWorldSize * 2 + Math . floor ( pos . yy / 50 ) ; var roomIndex = reverseRooms [ roomId ] ; if ( roomIndex === 0 ) { throw new Error ( 'Honk' ) ; } else { roomIndex = reverseRooms [ roomId ] ; } return ( roomIndex - 1 ) * 50 * 50 + pos . xx % 50 * 50 + pos . yy % 50 ; }
Handles converting WorldPositions back and forth from heap indexes
Handles converting WorldPositions back and forth from heap indexes