#include "Tile.h" #include "Tool/Tool_String.h" Tile::Tile() { } Tile::Tile(std::string Path) : Sprite() { InitInfo(Path); if (std::get(m_data["path"]) == "") m_data["path"] = "sprite/character/common/circlecooltime.img"; m_texture = new Texture(std::get(m_data["path"]), std::get(m_data["idx"])); Sprite::Init(); } Tile::~Tile() { } void Tile::SetPos(VecFPos pos) { pos.y += std::get(m_data["pos"]); Sprite::SetPos(pos); } void Tile::InitInfo(std::string Path) { ScriptData Data = AssetManager::GetInstance().GetScriptInfo(Path); m_data["pos"] = 0; while (!Data.IsEnd()) { std::string Segment = Data.Get(); if (Segment == "[IMAGE]") { std::string PathBuf = Tool_toLowerCase(Data.Get()); m_data["path"] = "sprite/" + PathBuf; m_data["idx"] = std::stoi(Data.Get()); } else if (Segment == "[img pos]") { m_data["pos"] = std::stoi(Data.Get()); } } }