@@ -51,18 +51,18 @@ impl Command for BuildTalkCommand {
51
51
}
52
52
53
53
/// A recursive function that spawns all the nodes from a talk builder and adds them in the given hashmap.
54
- /// It is used as the first pass of the building, so we have all the entities spawned and the build_node entities map filled.
54
+ /// It is used as the first pass of the building, so we have all the entities spawned and the `build_node_entities` map filled.
55
55
fn spawn_dialogue_entities (
56
56
talk_builder : & TalkBuilder < NonEmpty > ,
57
- mut build_node_entities : & mut HashMap < BuildNodeId , Entity > ,
57
+ build_node_entities : & mut HashMap < BuildNodeId , Entity > ,
58
58
world : & mut World ,
59
59
) {
60
60
for n in talk_builder. queue . iter ( ) {
61
61
let e = world. spawn_empty ( ) . id ( ) ;
62
62
build_node_entities. insert ( n. id . clone ( ) , e) ;
63
63
64
64
for ( _, inner_builder) in n. choices . iter ( ) {
65
- spawn_dialogue_entities ( inner_builder, & mut build_node_entities, world) ;
65
+ spawn_dialogue_entities ( inner_builder, build_node_entities, world) ;
66
66
}
67
67
}
68
68
}
@@ -82,7 +82,7 @@ fn spawn_dialogue_entities(
82
82
fn add_relationships (
83
83
root : Entity ,
84
84
talk_builder : TalkBuilder < NonEmpty > ,
85
- mut build_node_entities : & mut HashMap < BuildNodeId , Entity > ,
85
+ build_node_entities : & mut HashMap < BuildNodeId , Entity > ,
86
86
world : & mut World ,
87
87
) -> Vec < Entity > {
88
88
let mut parent = root;
@@ -129,7 +129,7 @@ fn add_relationships(
129
129
choices_texts. push ( choice_text) ;
130
130
// recursively spawn the branches
131
131
let branch_leaves =
132
- add_relationships ( child, inner_builder, & mut build_node_entities, world) ;
132
+ add_relationships ( child, inner_builder, build_node_entities, world) ;
133
133
leaves. extend ( branch_leaves) ;
134
134
}
135
135
// insert the ChoicesTexts component
@@ -141,7 +141,7 @@ fn add_relationships(
141
141
142
142
// Let's add the extra connections here
143
143
process_manual_connections (
144
- & build_node_entities,
144
+ build_node_entities,
145
145
& build_node. manual_connections ,
146
146
child,
147
147
world,
@@ -160,15 +160,15 @@ fn add_relationships(
160
160
161
161
/// Connect the node to the given nodes.
162
162
fn process_manual_connections (
163
- manual_connections_map : & HashMap < BuildNodeId , Entity > ,
163
+ build_node_entities : & HashMap < BuildNodeId , Entity > ,
164
164
manual_connections : & [ BuildNodeId ] ,
165
165
child : Entity ,
166
166
world : & mut World ,
167
167
) {
168
168
if !manual_connections. is_empty ( ) {
169
169
for input_id in manual_connections {
170
170
// get the entity node from the map
171
- let entity_to_connect_to = manual_connections_map . get ( input_id) ;
171
+ let entity_to_connect_to = build_node_entities . get ( input_id) ;
172
172
173
173
// if the node is not present, log a warning and skip it
174
174
if entity_to_connect_to. is_none ( ) {
0 commit comments