grafika_komputerowa/grk/project/GameUtils.h

38 lines
628 B
C
Raw Normal View History

2024-01-10 20:56:06 +01:00
#include <list>
#include "Sun.h"
2024-01-03 22:06:27 +01:00
#pragma once
class GameUtils
{
private:
// Private constructor to prevent external instantiation
2024-01-10 20:56:06 +01:00
GameUtils() : aspectRatio(1.f)
{
this->suns = new std::list<Sun*>();
}
std::list<Sun*>* suns;
float aspectRatio;
2024-01-03 22:06:27 +01:00
public:
2024-01-10 20:56:06 +01:00
float getAspectRatio() {
return aspectRatio;
}
void setAspectRatio(float value) {
aspectRatio = value;
}
std::list<Sun*>* getSuns() {
return suns;
}
static GameUtils* getInstance()
2024-01-03 22:06:27 +01:00
{
static GameUtils instance; // Jedna i jedyna instancja
2024-01-10 20:56:06 +01:00
return &instance;
2024-01-03 22:06:27 +01:00
}
};