Best JavaScript code snippet using stryker-parent
CCArmatureDataManager.js
Source:CCArmatureDataManager.js
1/****************************************************************************2 Copyright (c) 2011-2012 cocos2d-x.org3 Copyright (c) 2013-2014 Chukong Technologies Inc.4 http://www.cocos2d-x.org5 Permission is hereby granted, free of charge, to any person obtaining a copy6 of this software and associated documentation files (the "Software"), to deal7 in the Software without restriction, including without limitation the rights8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell9 copies of the Software, and to permit persons to whom the Software is10 furnished to do so, subject to the following conditions:11 The above copyright notice and this permission notice shall be included in12 all copies or substantial portions of the Software.13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE16 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER17 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN19 THE SOFTWARE.20 ****************************************************************************/21/**22 * RelativeData uses to save plist files, armature files, animations and textures for armature data manager.23 * @constructor24 */25ccs.RelativeData = function(){26 this.plistFiles=[];27 this.armatures=[];28 this.animations=[];29 this.textures=[];30};31/**32 * ccs.armatureDataManager is a singleton object which format and manage armature configuration and armature animation33 * @class34 * @name ccs.armatureDataManager35 */36ccs.armatureDataManager = /** @lends ccs.armatureDataManager# */{37 _animationDatas: {},38 _armatureDatas: {},39 _textureDatas: {},40 _autoLoadSpriteFile: false,41 _relativeDatas: {},42 s_sharedArmatureDataManager: null,43 /**44 * Removes armature cache data by configFilePath45 * @param {String} configFilePath46 */47 removeArmatureFileInfo:function(configFilePath){48 var data = this.getRelativeData(configFilePath);49 if(data){50 var i, obj;51 for (i = 0; i < data.armatures.length; i++) {52 obj = data.armatures[i];53 this.removeArmatureData(obj);54 }55 for ( i = 0; i < data.animations.length; i++) {56 obj = data.animations[i];57 this.removeAnimationData(obj);58 }59 for ( i = 0; i < data.textures.length; i++) {60 obj = data.textures[i];61 this.removeTextureData(obj);62 }63 for ( i = 0; i < data.plistFiles.length; i++) {64 obj = data.plistFiles[i];65 cc.spriteFrameCache.removeSpriteFramesFromFile(obj);66 }67 delete this._relativeDatas[configFilePath];68 ccs.dataReaderHelper.removeConfigFile(configFilePath);69 }70 },71 /**72 * Adds armature data73 * @param {string} id The id of the armature data74 * @param {ccs.ArmatureData} armatureData75 */76 addArmatureData:function (id, armatureData, configFilePath) {77 var data = this.getRelativeData(configFilePath);78 if (data){79 data.armatures.push(id);80 }81 this._armatureDatas[id] = armatureData;82 },83 /**84 * Gets armatureData by id85 * @param {String} id86 * @return {ccs.ArmatureData}87 */88 getArmatureData:function (id) {89 var armatureData = null;90 if (this._armatureDatas) {91 armatureData = this._armatureDatas[id];92 }93 return armatureData;94 },95 /**96 * Removes armature data from armature data manager.97 * @param {string} id98 */99 removeArmatureData:function(id){100 if (this._armatureDatas[id])101 delete this._armatureDatas[id];102 },103 /**104 * Adds animation data to armature data manager.105 * @param {String} id106 * @param {ccs.AnimationData} animationData107 */108 addAnimationData:function (id, animationData, configFilePath) {109 var data = this.getRelativeData(configFilePath);110 if(data)111 data.animations.push(id);112 this._animationDatas[id] = animationData;113 },114 /**115 * Gets animationData by id116 * @param {String} id117 * @return {ccs.AnimationData}118 */119 getAnimationData:function (id) {120 var animationData = null;121 if (this._animationDatas[id]) {122 animationData = this._animationDatas[id];123 }124 return animationData;125 },126 /**127 * Removes animation data128 * @param {string} id129 */130 removeAnimationData:function(id){131 if (this._animationDatas[id])132 delete this._animationDatas[id];133 },134 /**135 * Adds texture data to Armature data manager.136 * @param {String} id137 * @param {ccs.TextureData} textureData138 */139 addTextureData:function (id, textureData, configFilePath) {140 var data = this.getRelativeData(configFilePath);141 if (data) {142 data.textures.push(id);143 }144 this._textureDatas[id] = textureData;145 },146 /**147 * Gets textureData by id148 * @param {String} id149 * @return {ccs.TextureData}150 */151 getTextureData:function (id) {152 var textureData = null;153 if (this._textureDatas) {154 textureData = this._textureDatas[id];155 }156 return textureData;157 },158 /**159 * Removes texture data by id160 * @param {string} id161 */162 removeTextureData:function(id){163 if (this._textureDatas[id])164 delete this._textureDatas[id];165 },166 /**167 * Adds ArmatureFileInfo, it is managed by CCArmatureDataManager.168 * @param {String} imagePath169 * @param {String} plistPath170 * @param {String} configFilePath171 * @example172 * //example1173 * ccs.armatureDataManager.addArmatureFileInfo("res/test.json");174 * //example2175 * ccs.armatureDataManager.addArmatureFileInfo("res/test.png","res/test.plist","res/test.json");176 */177 addArmatureFileInfo:function (/*imagePath, plistPath, configFilePath*/) {178 var imagePath, plistPath, configFilePath;179 switch(arguments.length){180 case 1:181 configFilePath = arguments[0];182 this.addRelativeData(configFilePath);183 this._autoLoadSpriteFile = true;184 ccs.dataReaderHelper.addDataFromFile(configFilePath);185 break;186 case 3:187 imagePath = arguments[0];188 plistPath = arguments[1];189 configFilePath = arguments[2];190 this.addRelativeData(configFilePath);191 this._autoLoadSpriteFile = false;192 ccs.dataReaderHelper.addDataFromFile(configFilePath);193 this.addSpriteFrameFromFile(plistPath, imagePath);194 }195 },196 /**197 * Adds ArmatureFileInfo, it is managed by CCArmatureDataManager.198 * @param {String} imagePath199 * @param {String} plistPath200 * @param {String} configFilePath201 * @param {Function} selector202 * @param {Object} target203 */204 addArmatureFileInfoAsync:function (/*imagePath, plistPath, configFilePath, selector, target*/) {205 var imagePath, plistPath, configFilePath, target, selector;206 switch(arguments.length){207 case 3:208 configFilePath = arguments[0];209 target = arguments[2];210 selector = arguments[1];211 this.addRelativeData(configFilePath);212 this._autoLoadSpriteFile = true;213 ccs.dataReaderHelper.addDataFromFileAsync("", "", configFilePath, selector,target);214 break;215 case 5:216 imagePath = arguments[0];217 plistPath = arguments[1];218 configFilePath = arguments[2];219 target = arguments[4];220 selector = arguments[3];221 this.addRelativeData(configFilePath);222 this._autoLoadSpriteFile = false;223 ccs.dataReaderHelper.addDataFromFileAsync(imagePath, plistPath, configFilePath, selector, target);224 this.addSpriteFrameFromFile(plistPath, imagePath);225 }226 },227 /**228 * Add sprite frame to CCSpriteFrameCache, it will save display name and it's relative image name229 * @param {String} plistPath230 * @param {String} imagePath231 * @param {String} configFilePath232 */233 addSpriteFrameFromFile:function (plistPath, imagePath, configFilePath) {234 var data = this.getRelativeData(configFilePath);235 if(data)236 data.plistFiles.push(plistPath);237 ccs.spriteFrameCacheHelper.addSpriteFrameFromFile(plistPath, imagePath);238 },239 /**240 * Returns whether or not need auto load sprite file241 * @returns {boolean}242 */243 isAutoLoadSpriteFile:function(){244 return this._autoLoadSpriteFile;245 },246 /**247 * Returns armature Data of Armature data manager.248 * @return {Object}249 */250 getArmatureDatas:function () {251 return this._armatureDatas;252 },253 /**254 * Returns animation data of Armature data manager.255 * @return {Object}256 */257 getAnimationDatas:function () {258 return this._animationDatas;259 },260 /**261 * Returns texture data of Armature data manager.262 * @return {Object}263 */264 getTextureDatas:function () {265 return this._textureDatas;266 },267 /**268 * Adds Relative data of Armature data manager.269 * @param {String} configFilePath270 */271 addRelativeData: function (configFilePath) {272 if (!this._relativeDatas[configFilePath])273 this._relativeDatas[configFilePath] = new ccs.RelativeData();274 },275 /**276 * Gets RelativeData of Armature data manager.277 * @param {String} configFilePath278 * @returns {ccs.RelativeData}279 */280 getRelativeData: function (configFilePath) {281 return this._relativeDatas[configFilePath];282 },283 /**284 * Clear data285 */286 clear: function() {287 this._animationDatas = {};288 this._armatureDatas = {};289 this._textureDatas = {};290 ccs.spriteFrameCacheHelper.clear();291 ccs.dataReaderHelper.clear();292 }...
Using AI Code Generation
1const configFilePath = require('stryker-parent').configFilePath;2const configFilePath = require('stryker').configFilePath;3const configFilePath = require('stryker-parent').configFilePath;4const configFilePath = require('stryker').configFilePath;5const configFilePath = require('stryker-parent').configFilePath;6const configFilePath = require('stryker').configFilePath;7const configFilePath = require('stryker-parent').configFilePath;8const configFilePath = require('stryker').configFilePath;9const configFilePath = require('stryker-parent').configFilePath;10const configFilePath = require('stryker').configFilePath;11const configFilePath = require('stryker-parent').configFilePath;12const configFilePath = require('stryker').configFilePath;13const configFilePath = require('stryker-parent').configFilePath;14const configFilePath = require('stryker').configFilePath;15const configFilePath = require('stryker-parent').configFilePath;16const configFilePath = require('stryker').configFilePath;17const configFilePath = require('stryker-parent').configFilePath;18const configFilePath = require('stryker').configFilePath;
Using AI Code Generation
1const configFilePath = require('stryker-parent').configFilePath;2const configFilePath = require('stryker-parent').configFilePath;3const configFilePath = require('stryker-parent').configFilePath;4const configFilePath = require('stryker-parent').configFilePath;5const configFilePath = require('stryker-parent').configFilePath;6const configFilePath = require('stryker-parent').configFilePath;7const configFilePath = require('stryker-parent').configFilePath;8const configFilePath = require('stryker-parent').configFilePath;9const configFilePath = require('stryker-parent').configFilePath;10const configFilePath = require('stryker-parent').configFilePath;11const configFilePath = require('stryker-parent').configFilePath;12const configFilePath = require('stryker-parent').configFilePath;13const configFilePath = require('stryker-parent').configFilePath;14const configFilePath = require('stryker-parent').configFilePath;15const configFilePath = require('stryker-parent').configFilePath;16const configFilePath = require('stryker-parent').configFilePath;17const configFilePath = require('stryker-parent').configFilePath;18const configFilePath = require('stryker-parent
Using AI Code Generation
1var strykerParent = require('stryker-parent');2var configFilePath = strykerParent.configFilePath;3console.log(configFilePath());4var strykerParent = require('stryker-parent');5var configFilePath = strykerParent.configFilePath;6module.exports = function(config){7 config.set({8 configFilePath('stryker.conf.js')9 });10};11var strykerParent = require('stryker-parent');12var configFilePath = strykerParent.configFilePath;13module.exports = function(config){14 config.set({15 configFilePath('stryker.conf.js', 'test.js')16 });17};
Using AI Code Generation
1const strykerParent = require('stryker-parent');2const configFilePath = strykerParent.configFilePath('stryker.conf.js');3console.log(configFilePath);4const strykerParent = require('stryker-parent');5const configFilePath = strykerParent.configFilePath('stryker.conf.js');6console.log(configFilePath);7const strykerParent = require('stryker-parent');8const configFilePath = strykerParent.configFilePath('stryker.conf.js');9console.log(configFilePath);10const strykerParent = require('stryker-parent');11const configFilePath = strykerParent.configFilePath('stryker.conf.js');12console.log(configFilePath);13const strykerParent = require('stryker-parent');14const configFilePath = strykerParent.configFilePath('stryker.conf.js');15console.log(configFilePath);16const strykerParent = require('stryker-parent');17const configFilePath = strykerParent.configFilePath('stryker.conf.js');18console.log(configFilePath);19const strykerParent = require('stryker-parent');20const configFilePath = strykerParent.configFilePath('stryker.conf.js');21console.log(configFilePath);22const strykerParent = require('stryker-parent');23const configFilePath = strykerParent.configFilePath('stryker.conf.js');24console.log(configFilePath);25const strykerParent = require('stryker-parent');26const configFilePath = strykerParent.configFilePath('stryker.conf.js');27console.log(configFilePath);
Using AI Code Generation
1module.exports = {2 configFilePath: function() {3 return 'config/stryker.conf.js';4 }5};6{7}8{9 "dependencies": {10 }11}12var strykerParent = require('stryker-parent');13module.exports = {14 configFilePath: function() {15 return strykerParent.configFilePath();16 }17};18{19}20module.exports = {21 configFilePath: function() {22 return 'config/stryker.conf.js';23 }24};25{26}27module.exports = {28 configFilePath: function() {29 return 'config/stryker.conf.js';30 }31};32{33}
Using AI Code Generation
1import { configFilePath } from 'stryker-parent';2console.log(configFilePath);3module.exports = function(config) {4 config.set({5 });6};7module.exports = function(config) {8 config.set({9 });10};11module.exports = function(config) {12 config.set({13 });14};15module.exports = function(config) {16 config.set({17 });18};19module.exports = function(config) {20 config.set({21 });22};23module.exports = function(config) {
Using AI Code Generation
1const configFilePath = require('stryker-parent').configFilePath;2console.log(configFilePath('child.config.js'));3const configFilePath = require('stryker-parent').configFilePath;4console.log(configFilePath('child.config.js'));5const configFilePath = require('stryker-parent').configFilePath;6console.log(configFilePath('child.config.js'));7const configFilePath = require('stryker-parent').configFilePath;8console.log(configFilePath('child.config.js'));9const configFilePath = require('stryker-parent').configFilePath;10console.log(configFilePath('child.config.js'));11const configFilePath = require('stryker-parent').configFilePath;12console.log(configFilePath('child.config.js'));13const configFilePath = require('stryker-parent').configFilePath;14console.log(configFilePath('child.config.js'));
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!