#pragma once

#include <ReferenceCounter.h>
#include <Point.h>
#include <Text.h>

class Block;
class Chunk;
class FactoryCraftModel;

struct GroundModelPart
{
    int* indexList;
    int indexCount;
    int indexArraySize;
    Framework::Text name;
};

class ChunkModelBuilder : public Framework::ReferenceCounter
{
private:
    Chunk* zChunk;
    int type;

protected:
    FactoryCraftModel* target;
    Block** blocks();
    void setBlockPartOfModel(Block* zBlock, bool partOfModel);
    Framework::Point chunkCenter();

public:
    ChunkModelBuilder(FactoryCraftModel* target, Chunk* zChunk, int type);
    ~ChunkModelBuilder();
    virtual void buildModel() = 0;
    virtual bool updateLightning() = 0;
    FactoryCraftModel* zModel() const;
    int getType() const;
    virtual bool isTransparent() const = 0;
    virtual bool isPartOfModel(Block* zBlock) const = 0;
};