#pragma once

#include <Array.h>
#include <Text.h>
#include <Writer.h>

#include "TypeRegistry.h"

class ModelInfoFactory;

class ModelInfo : public virtual Framework::ReferenceCounter
{
private:
    Framework::Text modelPath;
    Framework::RCArray<Framework::Text> texturePaths;
    bool transparent;
    float size;

public:
    ModelInfo();
    ModelInfo(const char* modelPath,
        Framework::RCArray<Framework::Text> texturePaths,
        bool transparent,
        float size);
    void writeTo(Framework::StreamWriter* zWriter) const;
    void setModelPath(Framework::Text path);
    void addTexturePath(Framework::Text path);
    void setTransparent(bool transparent);
    void setSize(float size);

    Framework::Text getModelPath() const;
    Framework::RCArray<Framework::Text> getTexturePaths() const;
    bool isTransparent() const;
    float getSize() const;

    friend ModelInfoFactory;
};

class ModelInfoFactory : public ObjectTypeFactory<ModelInfo>
{
public:
    ModelInfoFactory();
    ModelInfo* fromJson(Framework::JSON::JSONObject* zJson) const override;
    Framework::JSON::JSONObject* toJsonObject(
        ModelInfo* zObject) const override;
    JSONObjectValidationBuilder* addToValidator(
        JSONObjectValidationBuilder* builder) const override;
};