#ifndef Face_hpp
#define Face_hpp

#include "Vertex.hpp"

class Face {
protected:
  const Vertex* vertex;
public:
  Face(const Vertex* v);
  virtual ~Face() = default;
  virtual Face* clone() const;
  virtual void render() const;
  virtual const bool contain(const Vertex* v) const;
  virtual const bool isDegenerated() const;
  virtual Face& swap(
    const Vertex* o,
    const Vertex* n
  );
};

class LineFace : public Face {
protected:
  const Vertex* vertex2;
public:
  LineFace(
    const Vertex* v,
    const Vertex* v2
  );
  Face* clone() const override;
  void render() const override;
  const bool contain(const Vertex* v) const override;
  const bool isDegenerated() const override;
  Face& swap(
    const Vertex* o,
    const Vertex* n
  ) override;
};

class TriangleFace : public LineFace {
protected:
  const Vertex* vertex3;
public:
  TriangleFace(
    const Vertex* v,
    const Vertex* v2,
    const Vertex* v3
  );
  Face* clone() const override;
  void render() const override;
  const bool contain(const Vertex* v) const override;
  const bool isDegenerated() const override;
  Face& swap(
    const Vertex* o,
    const Vertex* n
  ) override;
};

#endif
