<commit_before>from drillion.component import Component
from drillion.maths import Vector2

class PhysicsComponent(Component):
    def __init__(self, transform_component, update_phase, position=(0.0, 0.0),
                 velocity=(0.0, 0.0), acceleration=(0.0, 0.0), angle=0.0,
                 angular_velocity=0.0, angular_acceleration=0.0):
        super(PhysicsComponent, self).__init__()

        self.position = Vector2(*position)
        self.velocity = Vector2(*velocity)
        self.acceleration = Vector2(*acceleration)

        self.angle = angle
        self.angular_velocity = angular_velocity
        self.angular_acceleration = angular_acceleration

        self.transform_component = transform_component
        self.update_phase = update_phase

    def create(self):
        self.update_phase.add_handler(self)

    def delete(self):
        self.update_phase.add_handler(self)

    def update(self, dt):
        self.position += dt * self.velocity
        self.velocity += dt * self.acceleration

        self.angle += dt * self.angular_velocity
        self.angular_velocity += dt * self.angular_acceleration

        transform = self.transform_component.transform
        transform.reset()
        transform.rotate(self.angle)
        transform.translate(*self.position)
        self.transform_component.transform = transform
<commit_msg>Use transform accessors<commit_after>from drillion.component import Component
from drillion.maths import Transform2, Vector2

class PhysicsComponent(Component):
    def __init__(self, transform_component, update_phase, position=(0.0, 0.0),
                 velocity=(0.0, 0.0), acceleration=(0.0, 0.0), angle=0.0,
                 angular_velocity=0.0, angular_acceleration=0.0):
        super(PhysicsComponent, self).__init__()

        self.position = Vector2(*position)
        self.velocity = Vector2(*velocity)
        self.acceleration = Vector2(*acceleration)

        self.angle = angle
        self.angular_velocity = angular_velocity
        self.angular_acceleration = angular_acceleration

        self.transform_component = transform_component
        self.update_phase = update_phase

    def create(self):
        self.update_phase.add_handler(self)

    def delete(self):
        self.update_phase.add_handler(self)

    def update(self, dt):
        self.position += dt * self.velocity
        self.velocity += dt * self.acceleration

        self.angle += dt * self.angular_velocity
        self.angular_velocity += dt * self.angular_acceleration

        transform = Transform2(*self.transform_component.transform)
        transform.reset()
        transform.rotate(self.angle)
        transform.translate(*self.position)
        self.transform_component.transform = transform

{'fraction_non_alphanumeric': 0.0957562568008705, 'fraction_numerical': 0.016684802321363802, 'mean_word_length': 2.951289398280802, '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': '7562515', 'n_tokens_mistral': 805, 'n_tokens_neox': 730, 'n_words': 141}