package com.example.fitbot.pepper;

import com.aldebaran.qi.sdk.QiContext;
import com.aldebaran.qi.sdk.builder.SayBuilder;
import com.aldebaran.qi.sdk.object.conversation.Say;
import com.aldebaran.qi.sdk.object.locale.Locale;

public class PepperSpeechEvent extends AbstractPepperActionEvent {

    public final String phrase;
    public final Locale locale;

    public PepperSpeechEvent(String phrase, Locale locale) {
        this.locale = locale;
        this.phrase = phrase;
    }

    @Override
    public EPepperAction getAction() {
        return EPepperAction.ACTION_SPEAK;
    }

    /**
     * Returns a Say object, which can then be executed.
     */
    public Say getSay(QiContext context) {
        return SayBuilder.with(context)
                .withText(this.phrase)
                .withLocale(this.locale)
                .build();
    }
}
