<commit_before>import Texture from "./Texture"
import Engine from "../Engine"

class Graphics extends Texture
{
	constructor() {
		super()
		this.canvas = document.createElement("canvas")
		this.ctx = this.canvas.getContext("2d")
		this.updateFrames()
		this.needUpdate = true
	}

	resize(width, height) {
		this.width = width
		this.height = height
		this.canvas.width = width
		this.canvas.height = height
		this.updateFrames()
	}

	getInstance() {
		if(this.needUpdate) {
			this.loadFromCanvas(this.canvas, false)
			this.needUpdate = false
		}
		return this.instance
	}

	clearRect(x, y, width, height) {
		if(x === undefined) { x = 0 }
		if(y === undefined) { y = 0 }
		if(width === undefined) { width = this.width }
		if(height === undefined) { height = this.height} 
		this.ctx.clearRect(x, y, width, height)<commit_msg>Graphics should be auto loaded<commit_after>import Texture from "./Texture"

class Graphics extends Texture {
	constructor() {
		super()
		this.canvas = document.createElement("canvas")
		this.ctx = this.canvas.getContext("2d")
		this.updateFrames()
		this.needUpdate = true
		this.loaded = true
	}

	resize(width, height) {
		this.width = width
		this.height = height
		this.canvas.width = width
		this.canvas.height = height
		this.updateFrames()
	}

	getInstance() {
		if(this.needUpdate) {
			this.loadFromCanvas(this.canvas, false)
			this.needUpdate = false
		}
		return this.instance
	}

	clearRect(x, y, width, height) {
		if(x === undefined) { x = 0 }
		if(y === undefined) { y = 0 }
		if(width === undefined) { width = this.width }
		if(height === undefined) { height = this.height} 
		this.ctx.clearRect(x, y, width, height)
{'fraction_non_alphanumeric': 0.14371617558628982, 'fraction_numerical': 0.0036079374624173183, 'mean_word_length': 3.6222222222222222, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4521805', 'n_tokens_mistral': 611, 'n_tokens_neox': 548, 'n_words': 129}