/
domahes
/
Arcade
Обзор
Документация
Войти
/
domahes
/
Arcade
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
js/data/DRes.js
122 строки
3 KB
domahes
Update game scripts and data configurations
01 июн 2026, 10:11
01 июн 2026, 10:11
83cd2f8
Код
Авторство
О чём код?
/** * Created by Yitian Chen on 2019/1/7. */ function DRes(onload){ var _sf = this; //version code for resource this.code = 0; //scene resource this.resScene = []; //block resource this.resBBlock = []; //actor resource this.resActor = []; //decoration resource this.resDecorate = []; //animation resource this.resAnim = []; var onloadE = onload; //Read data var rd = new IRWFile("Resource.ifres"); rd.onload = function(){ _sf.code = rd.readShort(); var length = rd.readInt(); for(var i = 0;i<length;i++){ rd.readShort(); rd.readString(); rd.readString(); rd.readShort(); rd.readString(); rd.readShort(); rd.readShort(); rd.readShort(); rd.readShort(); rd.readShort(); } length = rd.readInt(); for(i = 0;i < length; i++){ var temp = new DResBaseBlock(rd); _sf.resBBlock[temp.id] = temp; } length = rd.readInt(); for(i = 0;i<length;i++){ temp = new DResActor(rd); _sf.resActor[temp.id] = temp; } length = rd.readInt(); for(i = 0;i<length;i++){ temp = new DResDecorate(rd); _sf.resDecorate[temp.id] = temp; } length = rd.readInt(); for(i = 0;i<length;i++){ temp = new DResScene(rd); _sf.resScene[temp.id] = temp; } length = rd.readInt(); for(i = 0;i<length;i++){ var type = rd.readShort(); if(type == -3310){ temp = new DResAnimFrame(rd); _sf.resAnim[temp.id] = temp; }else if(type == -2801){ temp = new DResAnimParticle(rd); _sf.resAnim[temp.id] = temp; } } onloadE(); }; /** * Find scene resource * @param id * @returns {DResScene} */ this.findResMap = function(id){ return _sf.resScene[id]; }; /** * Find block resource * @param id * @returns {DResBaseBlock} */ this.findResBlock = function(id){ return _sf.resBBlock[id]; }; /** * Find Actor resource * @param id * @returns {DResActor} */ this.findResActor = function(id){ return _sf.resActor[id]; }; /** * Find decoration resource * @param id * @returns {DResDecorate} */ this.findResDecorate = function(id){ return _sf.resDecorate[id]; }; /** * Find animation configuration data * @param id * @returns DResAnimFrame */ this.findResAnim = function(id){ return _sf.resAnim[id]; } }