import * as puppeteer from "puppeteer";
import { Rule } from "../rule";
import Word from "../word";
import Action from "./action";

export default class ComplexAction extends Action {

    public actions: Action[];

    constructor(word: Word, rule: Rule, actions: Action[]) {
        super(word, rule);
        this.actions = actions;
    }

    public async exec(page: puppeteer.Page): Promise<void> {
        for (const action of this.actions) {
            await action.exec(page);
        }
    }

}
