import * as mc from "@minecraft/server";
import range from "../../../modules/arrayRange.js";
import registerSystem from "../../../register/registerSystem.js";

import standIndex from "../list/standIndex.js";


export default class standPower extends registerSystem {
    constructor(name) {
        super();
        this.stand_name = name;
    }
    
    register(data) {
        this.main(this.stand_name, data);
    }
    
    
    main(name, data) {
        standIndex[name].eventData(this);
        
        this.listenForEvent("minecraft:tick", (eventData) => {
            this.getPlayers({tags:[`standMaster.${name}`], excludeTags:[`ui_using`]}).forEach(player => {
                return data(new standIndex[name](player));
            })
        })
        
    }
    
}

