<commit_before>package engine

import (
	"github.com/teomat/mater/collision"
)

type Callbacks struct {
	OnNewComponent func(entity *Entity, comp Component)
}

type Scene struct {
	Space        *collision.Space
	StaticEntity Entity
	Entities     map[int]*Entity
	Callbacks    Callbacks
}

func (scene *Scene) Init() {
	scene.Space = collision.NewSpace()
	scene.StaticEntity.Init()
	scene.Entities = make(map[int]*Entity, 32)
}

func (scene *Scene) Update(dt float64) {
	scene.Space.Step(dt)
	scene.StaticEntity.Update(dt)
	for _, entity := range scene.Entities {
		if entity.Enabled {
			entity.Update(dt)
		}
	}
}

func (scene *Scene) AddEntity(entity *Entity) {
	entity.Scene = scene
	scene.Entities[entity.Id()] = entity
}

func (scene *Scene) RemoveEntity(entity *Entity) {
	delete(scene.Entities, entity.Id())<commit_msg>fixed scene.StaticEntity not getting initialized correctly<commit_after>package engine

import (
	"github.com/teomat/mater/collision"
)

type Callbacks struct {
	OnNewComponent func(entity *Entity, comp Component)
}

type Scene struct {
	Space        *collision.Space
	StaticEntity Entity
	Entities     map[int]*Entity
	Callbacks    Callbacks
}

func (scene *Scene) Init() {
	scene.Space = collision.NewSpace()
	scene.StaticEntity.Init()
	scene.StaticEntity.Scene = scene
	scene.Entities = make(map[int]*Entity, 32)
}

func (scene *Scene) Update(dt float64) {
	scene.Space.Step(dt)
	scene.StaticEntity.Update(dt)
	for _, entity := range scene.Entities {
		if entity.Enabled {
			entity.Update(dt)
		}
	}
}

func (scene *Scene) AddEntity(entity *Entity) {
	entity.Scene = scene
	scene.Entities[entity.Id()] = entity
}

func (scene *Scene) RemoveEntity(entity *Entity) {
	delete(scene.Entities, entity.Id())
{'fraction_non_alphanumeric': 0.12478336221837089, 'fraction_numerical': 0.00462160600808781, 'mean_word_length': 4.498412698412698, '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': '4576357', 'n_tokens_mistral': 591, 'n_tokens_neox': 584, 'n_words': 132}