上一遍我们已经把osr的全部数据读出来了,虽然有些还不能看,但是至少全部的数据已经读取完毕了。这章我们来讲讲LifeBarGraph和TimeStamp。
##LifeBarGraph
在上一章我们读取出来的LifeBarGraph是下面这样的:
2254|1,4681|1,7548|1,9974|1,12181|1,15492|1,30489|1,32916|1,35135|1,37769|1,39988|1,42197|1,44386|1,47034|1,49220|1,51445|1,53629|1,55862|0.98,58614|1,60710|1,62901|1,65121|1,67437|0.99,69533|1,71695|...
ppy原文:Life bar graph: comma separated pairs u┃v, where u is the time in milliseconds into the song and v is a floating point value from 0 - 1 that represents the amount of life you have at the given time (0 = life bar is empty, 1= life bar is full).
大概意思就是LifeBar 是以逗号(,)分隔的形如"u|v"的字符串,其u是时间(毫秒),v是HP百分比
搞这么复杂,其实就是一个结构体啦
struct osrLifeBar
{
int time; //时间(毫秒)
float life; //生命值[0,1]
}
std::vector<osrLifeBar> LoadOsrLifeBar(const std::string str)
{
std::vector<osrLifeBar> LifeBar;
std::vector<std::string> lif