MCPcopy
hub / github.com/OpenBMB/AgentVerse / emitTurnEvent

Method emitTurnEvent

ui/src/classes/npc.ts:126–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124 }
125
126 emitTurnEvent(): void {
127 // Make the listener NPC turn to the speaker NPC.
128 if (this.targetNPC == undefined) return;
129 var direction = "";
130 switch (this.finalDirection) {
131 case DIRECTION.UP:
132 direction = "down";
133 break;
134 case DIRECTION.DOWN:
135 direction = "up";
136 break;
137 case DIRECTION.LEFT:
138 direction = "right";
139 break;
140 case DIRECTION.RIGHT:
141 direction = "left";
142 break;
143 }
144 eventsCenter.emit(this.targetNPC.name + "-" + direction);
145 this.setTargetNPC();
146 }
147
148 updateTextBox(): void {
149 if (this.textBox == undefined) return;

Callers 1

updateMethod · 0.95

Calls 2

setTargetNPCMethod · 0.95
emitMethod · 0.45

Tested by

no test coverage detected