<commit_before>import { Node } from "../../../codeCharta.model"
import { Box3, Vector3 } from "three"
import { ColorConverter } from "../../../util/colorConverter"
import convert from "color-convert"

export class CodeMapBuilding {
	public id: number
	public boundingBox: Box3
	public color: string
	public defaultColor: string
	public node: Node
	public parent?: CodeMapBuilding
	public name?: string

	constructor(id: number, box: Box3, node: Node, color: string) {
		this.id = id
		this.boundingBox = box
		this.color = color
		this.defaultColor = color
		this.node = node
	}

	public getCenterPoint(mapSize: number): Vector3 {
		return new Vector3(
			this.node.x0 - mapSize * 0.5 + this.node.width / 2,
			this.node.z0 + this.node.height,
			this.node.y0 - mapSize * 0.5 + this.node.length / 2
		)
	}

	public decreaseLightness(value: number) {
		const hsl = convert.hex.hsl(this.defaultColor)
		hsl[2] -= value
		hsl[2] = hsl[2] < 10 ? 10 : hsl[2]
		this.color = ColorConverter.convertNumberToHex(convert.hsl.hex([hsl[0], hsl[1], hsl[2]]))
	}

	public getColorVector(): Vector3 {
		return ColorConverter.colorToVector3(this.color)
	}

	public getDefaultColorVector(): Vector3 {
		return ColorConverter.colorToVector3(this.defaultColor)
	}

	public resetColor() {
		this.color = this.defaultColor
	}

	public setColor(color: string) {
		this.color = color
	}

	public equals(building: CodeMapBuilding) {
		return this.id === building.id
	}
}<commit_msg>added get methods to codemapbuilding #576<commit_after>import { Node } from "../../../codeCharta.model"
import { Box3, Vector3 } from "three"
import { ColorConverter } from "../../../util/colorConverter"
import convert from "color-convert"

export class CodeMapBuilding {
	private readonly _id: number
	private readonly _boundingBox: Box3
	private _color: string
	private readonly _defaultColor: string
	private readonly _node: Node

	constructor(id: number, box: Box3, node: Node, color: string) {
		this._id = id
		this._boundingBox = box
		this._color = color
		this._defaultColor = color
		this._node = node
	}

	public getCenterPoint(mapSize: number): Vector3 {
		return new Vector3(
			this._node.x0 - mapSize * 0.5 + this._node.width / 2,
			this._node.z0 + this._node.height,
			this._node.y0 - mapSize * 0.5 + this._node.length / 2
		)
	}

	public decreaseLightness(value: number) {
		const hsl = convert.hex.hsl(this._defaultColor)
		hsl[2] -= value
		hsl[2] = hsl[2] < 10 ? 10 : hsl[2]
		this._color = ColorConverter.convertNumberToHex(convert.hsl.hex([hsl[0], hsl[1], hsl[2]]))
	}

	public getColorVector(): Vector3 {
		return ColorConverter.colorToVector3(this._color)
	}

	public getDefaultColorVector(): Vector3 {
		return ColorConverter.colorToVector3(this._defaultColor)
	}

	public resetColor() {
		this._color = this._defaultColor
	}

	public equals(building: CodeMapBuilding) {
		return this._id === building._id
	}

	public get id(): number {
		return this._id
	}

	public get boundingBox(): Box3 {
		return this._boundingBox
	}

	public get color(): string {
		return this._color
	}

	public get node(): Node {
		return this._node
	}

	public setColor(color: string) {
		this._color = color
	}
}
{'fraction_non_alphanumeric': 0.1262992125984252, 'fraction_numerical': 0.02015748031496063, 'mean_word_length': 3.797583081570997, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5326295', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1066, 'n_words': 267}