-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintcache
1 lines (1 loc) · 5.61 KB
/
.eslintcache
1
[{"C:\\Projects\\React-Own\\pexeso\\src\\components\\App.js":"1","C:\\Projects\\React-Own\\pexeso\\src\\index.js":"2","C:\\Projects\\React-Own\\pexeso\\src\\components\\Game.js":"3","C:\\Projects\\React-Own\\pexeso\\src\\components\\MemCard.js":"4","C:\\Projects\\React-Own\\pexeso\\src\\hooks\\useWindowDimensions.js":"5","C:\\Projects\\React-Own\\pexeso\\src\\helpers\\index.js":"6","C:\\Projects\\React-Own\\pexeso\\src\\components\\EndGame.js":"7","C:\\Projects\\React-Own\\pexeso\\src\\components\\StartGame.js":"8","C:\\Projects\\React-Own\\pexeso\\src\\components\\ScoreBoard.js":"9"},{"size":2059,"mtime":1612895224069,"results":"10","hashOfConfig":"11"},{"size":201,"mtime":1612425398579,"results":"12","hashOfConfig":"11"},{"size":4821,"mtime":1612805962588,"results":"13","hashOfConfig":"11"},{"size":1851,"mtime":1612895440148,"results":"14","hashOfConfig":"11"},{"size":606,"mtime":1612432551467,"results":"15","hashOfConfig":"11"},{"size":2149,"mtime":1612638054364,"results":"16","hashOfConfig":"11"},{"size":2014,"mtime":1612895123881,"results":"17","hashOfConfig":"11"},{"size":3015,"mtime":1612804408187,"results":"18","hashOfConfig":"11"},{"size":845,"mtime":1612805976925,"results":"19","hashOfConfig":"11"},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1cxsen5",{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"33"},{"filePath":"34","messages":"35","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"36","messages":"37","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Projects\\React-Own\\pexeso\\src\\components\\App.js",[],"C:\\Projects\\React-Own\\pexeso\\src\\index.js",[],["40","41"],"C:\\Projects\\React-Own\\pexeso\\src\\components\\Game.js",[],"C:\\Projects\\React-Own\\pexeso\\src\\components\\MemCard.js",[],"C:\\Projects\\React-Own\\pexeso\\src\\hooks\\useWindowDimensions.js",[],"C:\\Projects\\React-Own\\pexeso\\src\\helpers\\index.js",["42"],"import React from 'react';\r\n\r\nexport const initPlayersSelection = () => {\r\n return [1,2,3,4].map( num => {\r\n var label = num > 1 ? 'Players' : 'Player';\r\n return {\r\n key: num,\r\n text: num + ' ' + label,\r\n value: num\r\n };\r\n });\r\n}\r\n\r\nexport const initSizeSelection = () => {\r\n return [[3,2],[4,3],[4,4],[5,4],[6,4]].map((size, index) => {\r\n return {\r\n key: index,\r\n text: size[0] + 'x' + size[1] + ' Cards',\r\n value: JSON.stringify(size)\r\n };\r\n })\r\n}\r\n\r\n/**\r\n* Returns shuffled array of images for memory cards.\r\n* @returns {Array} images - array of image URLs.\r\n*/\r\nexport const initImages = () => {\r\n const images = [];\r\n \r\n for (let i=1; i<13; i++) {\r\n const image = `${process.env.PUBLIC_URL}/img/animal-${i}.png`\r\n images.push(image);\r\n }\r\n\r\n return images.sort(() => Math.random() - 0.5);\r\n}\r\n\r\n/**\r\n* Returns shuffled array of images for memory cards.\r\n* @param {Array} size - array of 2 numbers defining the dimensions of the game deck (e.g. [4,3] => 4x3 cards).\r\n* @returns {Array<Object>} shuffledGame - array of card objects.\r\n*/\r\nexport const initDeck = (size) => {\r\n const newGame = []\r\n const images = initImages(); \r\n\r\n for (let i = 0; i < (size[0] * size[1]) / 2; i++) {\r\n const firstOption = {\r\n id: 2 * i,\r\n imageId: i,\r\n image: images[i],\r\n flipped: false,\r\n }\r\n const secondOption = {\r\n id: 2 * i + 1,\r\n imageId: i,\r\n image: images[i],\r\n flipped: false,\r\n }\r\n\r\n newGame.push(firstOption)\r\n newGame.push(secondOption)\r\n }\r\n\r\n const shuffledGame = newGame.sort(() => Math.random() - 0.5);\r\n return shuffledGame;\r\n\r\n}\r\n\r\n/**\r\n* Returns empty scoreboard - array of integers with number of items based on player count.\r\n* @param {Number} playerCount - number of players (integer).\r\n* @returns {Array<Number>} array of length given by number of players, each item equal to 0.\r\n*/\r\nexport const initScoreBoard = (playerCount) => {\r\n const scoreBoard = [];\r\n \r\n for (let i=0; i<playerCount; i++) { scoreBoard.push(0); }\r\n return(scoreBoard);\r\n}","C:\\Projects\\React-Own\\pexeso\\src\\components\\EndGame.js",["43"],"C:\\Projects\\React-Own\\pexeso\\src\\components\\StartGame.js",[],"C:\\Projects\\React-Own\\pexeso\\src\\components\\ScoreBoard.js",[],{"ruleId":"44","replacedBy":"45"},{"ruleId":"46","replacedBy":"47"},{"ruleId":"48","severity":1,"message":"49","line":1,"column":8,"nodeType":"50","messageId":"51","endLine":1,"endColumn":13},{"ruleId":"48","severity":1,"message":"52","line":2,"column":43,"nodeType":"50","messageId":"51","endLine":2,"endColumn":49},"no-native-reassign",["53"],"no-negated-in-lhs",["54"],"no-unused-vars","'React' is defined but never used.","Identifier","unusedVar","'Button' is defined but never used.","no-global-assign","no-unsafe-negation"]