glasshouse/src/dialogue/command/OpenRoomCommand.hx

20 lines
402 B
Haxe

package dialogue.command;
import event.EventBus;
import event.OpenRoomEvent;
class OpenRoomCommand implements ICommandHandler {
public var commandName:String = "room";
var eventBus:EventBus;
public function new(eventBus:EventBus) {
this.eventBus = eventBus;
}
public function handleCommand(args:Array<String>):Bool {
eventBus.publishEvent(new OpenRoomEvent(args[0]));
return true;
}
}