1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- #include "elemPropertyData.h"
- #include "plisthpp/redream.h"
- ElemPropertyData::ElemPropertyData()
- {
- //TODO: 把默认图标变成程序内部资源
- iconPath = "/Users/menglanluo/菜狗.png";
- dropConfig = 0;
- }
- bool ElemPropertyData::isSingleContainerKey(QString poolKey,QString newKey)
- {
- int index = getPoolIndex(poolKey);
- for(const auto &i:container[index].table){
- if(newKey == i.key){
- return false;
- }
- }
- return true;
- }
- bool ElemPropertyData::isSingleChildElemName(QString newName)
- {
- for(const auto &i:childElem){
- if(newName == i.name){
- return false;
- }
- }
- return true;
- }
- bool ElemPropertyData::isSingleAnimName(QString newName)
- {
- for(const auto &i:statusEffect){
- if(newName == i.name){
- return false;
- }
- }
- return true;
- }
- int ElemPropertyData::getCollAnimIndex(QString name)
- {
- for(int i=0;i<collAnim.size();i++){
- if(collAnim[i].name == name){
- return i;
- }
- }
- return -1;;
- }
- int ElemPropertyData::getStatusValIndex(QString statusVal)
- {
- for(int i=0;i<statusConfig.size();i++){
- if(statusConfig[i].statusValue == statusVal){
- return i;
- }
- }
- return -1;
- }
- int ElemPropertyData::getPoolIndex(QString poolName)
- {
- for(int i=0;i<container.size();i++){
- if(container[i].poolName == poolName){
- return i;
- }
- }
- return -1;
- }
- QList<QString> ElemPropertyData::getTimelineList(QString filePath)
- {
- if(timelineListMap.find(filePath) == timelineListMap.end()){
- QList<QString> list = Redream::getInstance()->getTimelineFromRedream(filePath.toStdString());
- timelineListMap[filePath] = list;
- return list;
- }
- return timelineListMap[filePath];
- }
|