From e5386e633b05062d67f4b0df352c283eb7c7ab5b Mon Sep 17 00:00:00 2001
From: chimchooree The MessageBus is a node singleton that delivers messages and data between objects. It rests at res://Singleton/MessageBus.gd. A handler first subscribes to a topic. When a particular topic comes up, it is published and passed to the subscribed handlers. When a topic is no longer relevant to a handler or the handler exited the tree, it unsubscribes. Also, all objects that inherit from the base request a ref_id at ready.
+ flow
+
+
+ signals
+
+
+
+ variables
+
+
int designate_ref_id()
increments current_ref_id by one then returns it.
void publish(String topic, ??? data)
If the topic has any active subscriptions, its handlers are prompted to handle the data.
void subscribe(String topic, Object handler)
An entry in topics is made for the topic if needed, then the handler is added to the topic's list.
void unsubscribe(String topic, Object handler)
if the topic has an active subscription, the given handler is erased from the topic's list.
void _on_handler_tree_exited(String topic, Object handler)
During subscribe, the handler is connected to execute this if it exits the tree. It unsubscribes the handler from the topic.
The Base is a node with IDs, a name, and a description. It rests at res://Entity/Base.gd.
At ready, it gains a ref_id from the MessageBus.
Color get_base_id ()
base_id getter
??? get_base_id_in_hex()
returns base_id in hex
String get_desc()
returns description in current language
String get_desc_key()
desc_key getter
String get_display_name()
returns display name in current language
bool get_is_player()
returns whether this object is the player
void set_ref_id(new_ref_id)
ref_id setter
int get_ref_id()
ref_id getter
bool compare_base_id(second_object)
returns whether this object and the given object are the same kind of object.
bool compare_base_id_to_hex(hex)
returns whether this object has the given hex as a base id.
bool compare_ref_id(second_object)
returns whether this object and the given object are the exact same object.
??? make_instance(path)
returns an instance of the scene at the given path.
The KnowledgeBase is a node singleton that stores and manages all the knowledge in the game. It rests at res://Singleton/KnowledgeBase.gd.
On ready, the encountered, forgot, and learned topics and handlers are set up.
Knowledge is learned by setting
+
+
Also, all objects that inherit from the base request a ref_id at ready.
int designate_ref_id()
increments current_ref_id by one then returns it.
void publish(String topic, ??? data)
If the topic has any active subscriptions, its handlers are prompted to handle the data.
void subscribe(String topic, Object handler)
An entry in topics is made for the topic if needed, then the handler is added to the topic's list.
void unsubscribe(String topic, Object handler)
if the topic has an active subscription, the given handler is erased from the topic's list.
void _on_handler_tree_exited(String topic, Object handler)
During subscribe, the handler is connected to execute this if it exits the tree. It unsubscribes the handler from the topic.
The MessageBus is a node singleton that delivers messages and data between objects. It rests at res://Singleton/MessageBus.gd.
A handler first subscribes to a topic. When a particular topic comes up, it is published and passed to the subscribed handlers. When a topic is no longer relevant to a handler or the handler exited the tree, it unsubscribes.
Also, all objects that inherit from the base request a ref_id at ready.
int designate_ref_id()
increments current_ref_id by one then returns it.
void publish(String topic, ??? data)
If the topic has any active subscriptions, its handlers are prompted to handle the data.
void subscribe(String topic, Object handler)
An entry in topics is made for the topic if needed, then the handler is added to the topic's list.
void unsubscribe(String topic, Object handler)
if the topic has an active subscription, the given handler is erased from the topic's list.
void _on_handler_tree_exited(String topic, Object handler)
During subscribe, the handler is connected to execute this if it exits the tree. It unsubscribes the handler from the topic.
I'll link social media, etc, later.
I'll link social media, etc, later.