mitushkin-infa/FigureList.h

32 lines
871 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Менеджер фигур: хранит все фигуры поля и работает с файлом
#ifndef FigureListH
#define FigureListH
#include <vector>
#include "BaseFigure.h"
class TFigureManager
{
private:
std::vector<TFigure*> list; // фигуры в порядке наложения (последняя - сверху)
int lastNum; // последний выданный номер
TFigure* MakeFigure(String type, int aNum);
void FreeAll();
public:
TFigureManager();
~TFigureManager();
TFigure* Add(String type, int ax, int ay, int aw, int ah, TColor fill, TColor line);
void Delete(TFigure *f);
void Clear();
int Count();
TFigure* FindAt(int px, int py);
bool ToTop(TFigure *f);
void PaintAll(TCanvas *c);
void Save(String fileName);
void Load(String fileName);
};
#endif