抽象多媒体类, 修复gtest问题
This commit is contained in:
25
include/mediaService.h
Normal file
25
include/mediaService.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#include <imageService.h>
|
||||
#include <UtilTool.h>
|
||||
#include <string>
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
class MediaService
|
||||
{
|
||||
private:
|
||||
ImageService *imageService = nullptr;
|
||||
MediaType type;
|
||||
sf::Texture *texture = nullptr;
|
||||
sf::Sprite *sprite = nullptr;
|
||||
int client_width = 0;
|
||||
int client_height = 0;
|
||||
public:
|
||||
MediaService(const std::string &filename, int width, int height);
|
||||
~MediaService(){
|
||||
delete texture;
|
||||
delete sprite;
|
||||
}
|
||||
sf::Sprite GetSprite()
|
||||
{
|
||||
return *sprite;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user