#include <Widget/Layout/CompoundWidget/WorldAvatarPicker/WorldAvatarPicker.hpp>
#include <Widget/Layout/Row/Row.hpp>
#include <Widget/IconToggle/IconToggle.hpp>

std::vector<Widget*> WorldAvatarPicker::makeToggles(WorldAvatar &selection)
{
    std::vector<Widget*> toggles;

    for (const WorldAvatar &avatar : worldAvatarList)
    {
        toggles.push_back(new IconToggle(selection, avatar, getWorldAvatarMaterial(avatar)));
    }

    return toggles;
}

WorldAvatarPicker::WorldAvatarPicker(WorldAvatar &selection) : CompoundWidget(
    new Row(makeToggles(selection))
)
{}