Skip to content

Commit c11cf48

Browse files
committed
Method name changes.
1 parent 0a80114 commit c11cf48

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main/java/engine/components/Component.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
* behaviors, following a component-based design pattern.
1111
* </p>
1212
* <p>
13-
* Each component should manage its lifecycle, with {@code initialize()},
14-
* {@code update()}, and {@code cleanup()} methods, allowing nodes to manage
13+
* Each component should manage its lifecycle, with {@code onAttach()},
14+
* {@code update()}, and {@code onDetach()} methods, allowing nodes to manage
1515
* their behavior lifecycle cleanly.
1616
* </p>
1717
*/
@@ -44,24 +44,22 @@ public interface Component {
4444
void update(float tpf);
4545

4646
/**
47-
* Initializes the component before it becomes active.
47+
* Called when the component is attached to a {@link SceneNode}.
4848
* <p>
49-
* This is called once after the component is attached to a {@link SceneNode}.
50-
* It allows the component to set up necessary resources, state, or perform
51-
* other preparatory work.
49+
* This allows the component to set up necessary resources, state, or perform
50+
* other preparatory work specific to being added to a node.
5251
* </p>
5352
*/
54-
void initialize();
53+
void onAttach();
5554

5655
/**
57-
* Cleans up resources and performs necessary teardown when the component is
58-
* removed or the scene is unloaded.
56+
* Called when the component is detached from a {@link SceneNode}.
5957
* <p>
6058
* This ensures no memory is leaked, threads are terminated, or other
6159
* resources are left hanging by cleaning up internal state and releasing
6260
* references.
6361
* </p>
6462
*/
65-
void cleanup();
63+
void onDetach();
6664

6765
}

0 commit comments

Comments
 (0)