Created
November 11, 2017 14:17
-
-
Save gabriel403/067233ea6bc53c5016c8729fbd07aed5 to your computer and use it in GitHub Desktop.
crap sorting function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.sortByTags = function(model) { | |
let score = 10000; | |
if (model.tags.includes('pc')) {score -= 1000} | |
if (model.tags.includes('monk')) {score -= 900} | |
if (model.tags.includes('ranger')) {score -= 800} | |
if (model.tags.includes('rogue')) {score -= 700} | |
if (model.tags.includes('fighter')) {score -= 600} | |
if (model.tags.includes('barbarian')) {score -= 500} | |
if (model.tags.includes('wizard')) {score -= 400} | |
if (model.tags.includes('sorcerer')) {score -= 300} | |
if (model.tags.includes('human')) {score -= 90} | |
if (model.tags.includes('elf')) {score -= 80} | |
if (model.tags.includes('halfling')) {score -= 70} | |
if (model.tags.includes('dwarf')) {score -= 60} | |
if (model.tags.includes('female')) {score -= 9} | |
if (model.tags.includes('male')) {score -= 8} | |
return score; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment