"use strict";

class TextureManager {
    _textures = {};

    load(name, path) {
        var me = this;
        return new Promise((resolve) => {
            new THREE.TextureLoader().load(path, (texture) => {
                texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
                me._textures[name] = texture;
                resolve();
            });
        });
    }

    get(textureName) {
        return this._textures[textureName];
    }
}