Stations Package#

Submodules#

Occupiable Station Class#

class game.common.stations.occupiable_station.OccupiableStation(held_item: Item | None = None, occupied_by: GameObject | None = None)[source]#

Bases: Occupiable, Station

OccupiableStation Class Notes:

Occupiable Station objects inherit from both the Occupiable and Station classes. This allows for other objects to be “on top” of the Occupiable Station. For example, an Avatar object can be on top of this object. Since Stations can contain items, items can be stored in this object too.

Any GameObject or Item can be in an Occupiable Station.

Occupiable Station Example is a small file that shows an example of how this class can be used. The example class can be deleted or expanded upon if necessary.

from_json(data: dict) Self[source]#

Occupiable Station Example Class#

class game.common.stations.occupiable_station_example.OccupiableStationExample(held_item: Item | None = None)[source]#

Bases: OccupiableStation

take_action(avatar: Avatar) Item | None[source]#

In this example of what an occupiable station could do, the avatar picks up the item from this station to show the station’s purpose. :param avatar: :return:

Station Module#

class game.common.stations.station.Station(held_item: Item | None = None, **kwargs)[source]#

Bases: GameObject

Station Class Notes:

Station objects inherit from GameObject and can contain Item objects in them.

Players can interact with Stations in different ways by using the take_action() method. Whatever is specified in this method will control how players interact with the station. The Avatar and Item classes have methods that go through this process. Refer to them for more details.

The Occupiable Station Example class demonstrates an avatar object receiving the station’s stored item. The Station Receiver Example class demonstrates an avatar depositing its held item into a station. These are simple ideas for how stations can be used. These can be heavily added onto for more creative uses!

from_json(data: dict) Self[source]#
property held_item: Item | None#
take_action(avatar: Avatar) Item | None[source]#
to_json() dict[source]#

Station Example#

class game.common.stations.station_example.StationExample(held_item: Item | None = None)[source]#

Bases: Station

take_action(avatar: Avatar) Item | None[source]#

In this example of what a station could do, the avatar picks up the item from this station to show the station’s purpose. :param avatar: :return:

Station Receiver Example#

class game.common.stations.station_receiver_example.StationReceiverExample(held_item: Item | None = None)[source]#

Bases: Station

take_action(avatar: Avatar) None[source]#

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:

Module contents#