Last active
August 29, 2015 14:13
-
-
Save battaile/da764d7935c9f17d3b4f to your computer and use it in GitHub Desktop.
To Display College Names for newly genned players in basketball-gm
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
/** | |
* @name data.colleges | |
* @namespace College names. | |
*/ | |
define([], function () { | |
"use strict"; | |
var college; | |
// Name, Cumulative Frequency | |
college = [ | |
["Kentucky", 1.8], | |
["Duke", 3.6], | |
["Kansas", 5.3], | |
["North Carolina", 6.9], | |
["UCLA", 8.4], | |
["Arizona", 9.6], | |
["Florida", 10.8], | |
["Connecticut", 11.7], | |
["Texas", 12.5], | |
["Washington", 13.3], | |
["Georgia Tech", 14], | |
["Michigan St.", 14.7], | |
["Georgetown", 15.3], | |
["LSU", 15.9], | |
["Memphis", 16.5], | |
["Michigan", 17.1], | |
["Southern Cal", 17.7], | |
["Syracuse", 18.3], | |
["Marquette", 18.8], | |
["Wake Forest", 19.3], | |
["Baylor", 19.7], | |
["Colorado", 20.1], | |
["Gonzaga", 20.5], | |
["Indiana", 20.9], | |
["New Mexico", 21.3], | |
["Ohio St.", 21.7], | |
["Stanford", 22.1], | |
["UNLV", 22.5], | |
["Alabama", 22.8], | |
["Arkansas", 23.1], | |
["California", 23.4], | |
["Creighton", 23.7], | |
["Louisville", 24], | |
["Maryland", 24.3], | |
["Miami-FL", 24.6], | |
["Missouri", 24.9], | |
["Nevada", 25.2], | |
["Oklahoma St.", 25.5], | |
["Purdue", 25.8], | |
["Tennessee", 26.1], | |
["Texas A&M", 26.4], | |
["Vanderbilt", 26.7], | |
["Wichita St.", 27], | |
["Wisconsin", 27.3], | |
["Arizona St.", 27.5], | |
["Boston College", 27.7], | |
["Butler", 27.9], | |
["BYU", 28.1], | |
["Cincinnati", 28.3], | |
["Clemson", 28.5], | |
["Dayton", 28.7], | |
["Detroit", 28.9], | |
["Fresno St.", 29.1], | |
["Illinois", 29.3], | |
["Iowa", 29.5], | |
["N.C. State", 29.7], | |
["Oregon", 29.9], | |
["Oregon St.", 30.1], | |
["Pittsburgh", 30.3], | |
["San Diego St.", 30.5], | |
["St. John's", 30.7], | |
["St. Mary's", 30.9], | |
["Utah", 31.1], | |
["VCU", 31.3], | |
["Villanova", 31.5], | |
["Virginia", 31.7], | |
["Washington St.", 31.9], | |
["Western Kentucky", 32.1], | |
["Belmont", 32.2], | |
["Bucknell", 32.3], | |
["Central Michigan", 32.4], | |
["Cleveland St.", 32.5], | |
["Colorado St.", 32.6], | |
["Davidson", 32.7], | |
["DePaul", 32.8], | |
["Eastern Wash.", 32.9], | |
["Georgia", 33], | |
["Harvard", 33.1], | |
["IUPUI", 33.2], | |
["Kansas St.", 33.3], | |
["La Salle", 33.4], | |
["Lehigh", 33.5], | |
["Long Beach St.", 33.6], | |
["Louisiana Tech", 33.7], | |
["Minnesota", 33.8], | |
["Morehead St.", 33.9], | |
["Murray St.", 34], | |
["Norfolk St.", 34.1], | |
["North Texas", 34.2], | |
["Oklahoma", 34.3], | |
["Old Dominion", 34.4], | |
["Rider", 34.5], | |
["Saint Joseph's", 34.6], | |
["Santa Clara", 34.7], | |
["Seton Hall", 34.8], | |
["South Dakota St.", 34.9], | |
["St. Bonaventure", 35], | |
["Temple", 35.1], | |
["Towson", 35.2], | |
["Tulsa", 35.3], | |
["UL Lafayette", 35.4], | |
["Utah Valley", 35.5], | |
["Virginia Tech", 35.6], | |
["Weber St.", 35.7], | |
["Western Carolina", 35.8], | |
["Western Michigan", 35.9], | |
["Xavier", 36] | |
]; | |
return { | |
college: college | |
}; | |
}); |
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
define(["dao", "globals", "core/finances", "data/colleges", "data/injuries", "data/names", "lib/bluebird", "lib/faces", "lib/underscore", "util/eventLog", "util/helpers", "util/random"], function (dao, g, finances, colleges, injuries, names, Promise, faces, _, eventLog, helpers, random) { | |
... | |
p.name = name(nationality); | |
p.college = college(); | |
... | |
function college() { | |
var c, fnRand, i; | |
fnRand = random.uniform(0, 36.0); | |
for (i = 0; i < colleges.college.length; i++) { | |
if (colleges.college[i][1]>= fnRand) { | |
break; | |
} | |
} | |
c = colleges.college[i][0]; | |
return c; | |
} | |
... | |
return { | |
addRatingsRow: addRatingsRow, | |
addStatsRow: addStatsRow, | |
genBaseMoods: genBaseMoods, | |
addToFreeAgents: addToFreeAgents, | |
bonus: bonus, | |
genContract: genContract, | |
setContract: setContract, | |
develop: develop, | |
injury: injury, | |
generate: generate, | |
ovr: ovr, | |
release: release, | |
skills: skills, | |
filter: filter, | |
madeHof: madeHof, | |
//value: value, | |
updateValues: updateValues, | |
retire: retire, | |
name: name, | |
college: college, | |
contractSeasonsRemaining: contractSeasonsRemaining, | |
moodColorText: moodColorText, | |
augmentPartialPlayer: augmentPartialPlayer | |
}; |
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
<!-- ko if: player.draft.round --> | |
Draft: <a data-bind="text: player.draft.year, attrLeagueUrl: {href: ['draft_summary', player.draft.year]}"></a> - Round <span data-bind="text: player.draft.round"></span> (Pick <span data-bind="text: player.draft.pick"></span>) by <span data-bind="text: player.draft.abbrev"></span> | |
<!-- /ko --> | |
<!-- ko if: !player.draft.round() --> | |
Undrafted: <span data-bind="text: player.draft.year"></span> | |
<!-- /ko --> | |
(<span data-bind="text: player.college"></span>)<br> |
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
p = player.filter(p, { | |
attrs: ["pid", "name", "college", |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source data: http://rpiratings.com/NBA.php