mirror of
https://github.com/hypervortex/VH-Bombsquad-Modded-Server-Files
synced 2025-11-07 17:36:08 +00:00
updated
This commit is contained in:
parent
d67551a303
commit
5ba4986d59
2403 changed files with 0 additions and 740883 deletions
38
dist/ba_data/python/ba/_nodeactor.py
vendored
38
dist/ba_data/python/ba/_nodeactor.py
vendored
|
|
@ -1,38 +0,0 @@
|
|||
# Released under the MIT License. See LICENSE for details.
|
||||
#
|
||||
"""Defines NodeActor class."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ba._messages import DieMessage
|
||||
from ba._actor import Actor
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import ba
|
||||
from typing import Any
|
||||
|
||||
|
||||
class NodeActor(Actor):
|
||||
"""A simple ba.Actor type that wraps a single ba.Node.
|
||||
|
||||
Category: **Gameplay Classes**
|
||||
|
||||
This Actor will delete its Node when told to die, and it's
|
||||
exists() call will return whether the Node still exists or not.
|
||||
"""
|
||||
|
||||
def __init__(self, node: ba.Node):
|
||||
super().__init__()
|
||||
self.node = node
|
||||
|
||||
def handlemessage(self, msg: Any) -> Any:
|
||||
if isinstance(msg, DieMessage):
|
||||
if self.node:
|
||||
self.node.delete()
|
||||
return None
|
||||
return super().handlemessage(msg)
|
||||
|
||||
def exists(self) -> bool:
|
||||
return bool(self.node)
|
||||
Loading…
Add table
Add a link
Reference in a new issue