1313
1414def _script_defines (scriptobj : EntityScriptType , name : str ) -> bool :
1515 """
16- Check whether scriptobj itself defines `name`, rather than inheriting
17- it from Entity. Since script classes are commonly subclasses of Entity
18- (for typing convenience), a plain hasattr() check would also match
19- Entity's own init/update/event, causing infinite recursion when they
20- are dispatched.
16+ Check whether scriptobj itself defines `` name` `, rather than inheriting
17+ it from :class:`~engine.core. Entity` . Since script classes are commonly
18+ subclasses of :class:`~engine.core.Entity` (for typing convenience), a
19+ plain hasattr() check would also match its own init/update/event,
20+ causing infinite recursion when they are dispatched.
2121
2222
2323 Args:
2424 scriptobj (EntityScriptType): The script object to check.
2525 name (str): The name of the method to check for.
2626
2727 Returns:
28- bool: True if scriptobj defines `name`, False otherwise.
28+ bool: True if scriptobj defines `` name` `, False otherwise.
2929 """
3030
3131 func : Optional [Callable ] = getattr (scriptobj , name , None )
@@ -39,16 +39,20 @@ class ObjectScriptEntity(Entity):
3939
4040 def __new__ (cls , * args : Any , scriptobj : EntityScriptType , ** kwargs : Any ) -> Any :
4141 """
42- Create an Entity configured to dispatch lifecycle calls to ``scriptobj``.
42+ Create an :class:`~engine.core.Entity` configured to dispatch lifecycle
43+ calls to ``scriptobj``.
4344
4445 Args:
45- *args (Any): Positional arguments forwarded to Entity.
46+ *args (Any): Positional arguments forwarded to
47+ Entity.
4648 scriptobj (EntityScriptType): Object script providing optional
4749 init, update, and event methods.
48- **kwargs (Any): Keyword arguments forwarded to Entity.
50+ **kwargs (Any): Keyword arguments forwarded to
51+ Entity.
4952
5053 Returns:
51- Any: Entity instance with object-script dispatch metadata attached.
54+ Any: :class:`~engine.core.Entity` instance with object-script
55+ dispatch metadata attached.
5256 """
5357
5458 kwargs ["scriptfile" ] = None
0 commit comments