<commit_before>/*
 * Copyright 2015 if(Team);
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

"use strict";

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
var Pool = {};

Pool.VERSION = "0.1";
Pool.API_VERSION = 1;

//Pool.SubPackage.someMethod
//Pool.Constructor


/**
 * @since 2015-02-26
 * @author onebone <<EMAIL>>
 * @author ChalkPE <<EMAIL>>
 * @param path {String | java.io.File} 서브 모듈이 저장된 소스 파일의 경로 및 파일 객체
 */
Pool.load = function(path){
	var content = Pool.IO.readAllLines(path);
	try{
		eval(content);
	}catch(e){
		Pool.showError(e);
	}
};

/**
 * @since 2015-02-26
 * @author ChalkPE <<EMAIL>>
 * @param error {Error} 출력할 에러
 */
Pool.showError = function(error){
	clientMessage(error.name + ": " + error.message + " at line " + error.lineNumber + "\n" + error.stack);
};

/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 */
Pool.Vector2 = function(x, y){
	this.x = Math.floor(x);
	this.y = Math.floor(y);
};
Pool.Vector2.prototype = {};
Pool.Vector2.prototype.equals = function(x, y){
	if(x instanceof Pool.Vector2 && arguments.length === 1){
		return x.x === this.x && x.y === this.y;
	}
	return Math.floor(x) === this.x && Math.floor(y) === this.y;
};
Pool.Vector2.prototype.toString = function(){
	return "[" + [this.x, this.y].join(", ") + "]";
}
Pool.Vector2.prototype.set = function(x, y){
	if(typeof x === "number"){
		this.x = Math.floor(x);
	}
	if(typeof y === "number"){
		this.y = Math.floor(y);
	}
};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Vector3 = function(x, y, z){
	this.x = Math.floor(x);
	this.y = Math.floor(y);
	this.z = Math.floor(z);
};
Pool.Vector3.prototype = {};
Pool.Vector3.prototype.equals = function(x, y, z){
	if(x instanceof Pool.Vector3 && arguments.length === 1){
		return x.x === this.x && x.y === this.y && x.z === this.z
	}
	return Math.floor(x) === this.x && Math.floor(y) === this.y && Math.floor(z) === this.z;
};
Pool.Vector3.prototype.toString = function(){
	return "[" + [this.x, this.y, this.z].join(", ") + "]";
}
Pool.Vector3.prototype.set = function(x, y, z){
	if(typeof x === "number"){
		this.x = Math.floor(x);
	}
	if(typeof y === "number"){
		this.y = Math.floor(y);
	}
	if(typeof z === "number"){
		this.z = Math.floor(z);
	}
};
Pool.Vector3.prototype.getDistance = function(first ssecond {
	return Math.hypot(first.x - second.x, first.y - second.y, first.z - second.z);
};





Pool.Map = {};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Canvas = {};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 * @param begin {Pool.Vector3} 시작점의 위치
 * @param end {Pool.Vector3} 종료점의 위치
 * @param blockId {int} 선을 이룰 블럭의 ID 값
 * @param blockDamage {int} 선을 이룰 블럭의 데미지 값
 * @see Bresenham's line algorithm
 */
Pool.Canvas.drawLine = function(begin, end, blockId, blockDamage){
	function drawLine2D(x0, y0, x1, y1, height, blockId, blockDamage){
	    var dx = Math.abs(x1 - x0);
	    var dy = Math.abs(y1 - y0);
	    var sx = (x0 < x1) ? 1 : -1;
	    var sy = (y0 < y1) ? 1 : -1;
	    var err = dx - dy;
	    <commit_msg>오류 수정 및 문서화 주석 추가<commit_after>/*
 * Copyright 2015 if(Team);
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

"use strict";

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
var Pool = {};

Pool.VERSION = "0.1";
Pool.API_VERSION = 1;

//Pool.SubPackage.someMethod
//Pool.Constructor


/**
 * @since 2015-02-26
 * @author onebone <<EMAIL>>
 * @author ChalkPE <<EMAIL>>
 * @param path {String | java.io.File} 서브 모듈이 저장된 소스 파일의 경로 및 파일 객체
 */
Pool.load = function(path){
	var content = Pool.IO.readAllLines(path);
	try{
		eval(content);
	}catch(e){
		Pool.showError(e);
	}
};

/**
 * @since 2015-02-26
 * @author ChalkPE <<EMAIL>>
 * @param error {Error} 출력할 에러
 */
Pool.showError = function(error){
	clientMessage(error.name + ": " + error.message + " at line " + error.lineNumber + "\n" + error.stack);
};





/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 */
Pool.Vector2 = function(x, y){
	this.x = Math.floor(x);
	this.y = Math.floor(y);
};

/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 */
Pool.Vector2.prototype = {};

/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 */
Pool.Vector2.prototype.equals = function(x, y){
	if(x instanceof Pool.Vector2 && arguments.length === 1){
		return x.x === this.x && x.y === this.y;
	}
	return Math.floor(x) === this.x && Math.floor(y) === this.y;
};

/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 */
Pool.Vector2.prototype.toString = function(){
	return "[" + [this.x, this.y].join(", ") + "]";
}

/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 */
Pool.Vector2.prototype.set = function(x, y){
	if(typeof x === "number"){
		this.x = Math.floor(x);
	}
	if(typeof y === "number"){
		this.y = Math.floor(y);
	}
};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Vector3 = function(x, y, z){
	this.x = Math.floor(x);
	this.y = Math.floor(y);
	this.z = Math.floor(z);
};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Vector3.prototype = {};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Vector3.prototype.equals = function(x, y, z){
	if(x instanceof Pool.Vector3 && arguments.length === 1){
		return x.x === this.x && x.y === this.y && x.z === this.z
	}
	return Math.floor(x) === this.x && Math.floor(y) === this.y && Math.floor(z) === this.z;
};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Vector3.prototype.toString = function(){
	return "[" + [this.x, this.y, this.z].join(", ") + "]";
}

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 * @brief 좌표를 설정합니다
 * @param x {int} X 좌표 (생략할 경우 변경하지 않습니다)
 * @param y {int} Y 좌표 (생략할 경우 변경하지 않습니다)
 * @param z {int} Z 좌표 (생략할 경우 변경하지 않습니다)
 */
Pool.Vector3.prototype.set = function(x, y, z){
	if(typeof x === "number"){
		this.x = Math.floor(x);
	}
	if(typeof y === "number"){
		this.y = Math.floor(y);
	}
	if(typeof z === "number"){
		this.z = Math.floor(z);
	}
};

/**
 * @since 2015-02-26
 * @author IchiKaku <<EMAIL>>
 * @brief 자신과 다른 좌표 사이의 거리를 구합니다
 * @param vec3 {Pool.Vector3} 거리를 구할 다른 좌표
 * @return {double} 자신과 vec3 사이의 거리
 */
Pool.Vector3.prototype.getDistance = function(vec3){
	return Math.hypot(this.x - vec3.x, this.y - vec3.y, this.z - vec3.z);
};





/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 */
Pool.Canvas = {};

/**
 * @since 2015-02-24
 * @author ChalkPE <<EMAIL>>
 * @param begin {Pool.Vector3} 시작점의 위치
 * @param end {Pool.Vector3} 종료점의 위치
 * @param blockId {int} 선을 이룰 블럭의 ID 값
 * @param blockDamage {int} 선을 이룰 블럭의 데미지 값
 * @see Bresenham's line algorithm
 */
Pool.Canvas.drawLine = function(begin, end, blockId, blockDamage){
	function drawLine2D(x0, y0, x1, y1, height, blockId, blockDamage){
	    var dx = Math.abs(x1 - x0);
	    var dy = Math.abs(y1 - y0);
	    var sx = (x0 < x1) ? 1 : -1;
	    var sy = (y0 < y1) ? 1 : -1;
	    var err = dx - dy;
	    
{'fraction_non_alphanumeric': 0.19285352255448557, 'fraction_numerical': 0.03560567663456665, 'mean_word_length': 3.218599679315874, 'pattern_counts': {'":': 2, '<': 57, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3323416', 'n_tokens_mistral': 3388, 'n_tokens_neox': 3307, 'n_words': 794}