#pragma once
#include <vector>
#include <string>
#include "nkcWinUtils.h"
// 構成要素
struct Element {
float x; // X座標
float y; // Y座標
float d; // サイズ
// コンストラクタ
Element(float X, float Y, float D) {
x = X;
y = Y;
d = D;
}
};
// フレーム情報
struct FrameInfo {
float eTime; // 時間
std::vector<Element> elements; // 要素群
// コンストラクタ
FrameInfo() : eTime(0) {}
};
// 映像オブジェクトクラス
class MovieObject {
std::vector<FrameInfo> _frame;
int _lastAccess;
bool _holdTargetSize;
public:
// コンストラクタ
MovieObject();
// テーブルからデータをセット
int SetData(nkc::STR_TABLE table);
// ファイル名からデータをセット
int SetData(const std::string& filename);
// 指定時間のオブジェクト情報を返す
std::vector<Element> GetElements(float sTime);
// フレーム数を返す
int GetNumFrames() { return (int)_frame.size(); }
// 空かどうか
bool IsEmpty() { return _frame.size() < 1; }
// 消去
void Clear() { _frame.clear(); _lastAccess = 0; }
};