Source code for game.common.stations.station_receiver_example

from game.common.avatar import Avatar
from game.common.enums import ObjectType
from game.common.items.item import Item
from game.common.stations.station import Station


# create example of station that takes held_item from avatar at inventory slot 0
[docs]class StationReceiverExample(Station): def __init__(self, held_item: Item | None = None): super().__init__(held_item=held_item) self.object_type = ObjectType.STATION_RECEIVER_EXAMPLE
[docs] def take_action(self, avatar: Avatar) -> None: """ In this example of what a type of station could do, the station takes the avatars held item and takes it for its own. :param avatar: :return: """ self.held_item = avatar.drop_held_item()