diff --git a/data/2027/trainingcamp.csv b/data/2027/trainingcamp.csv new file mode 100644 index 0000000..2f535cb --- /dev/null +++ b/data/2027/trainingcamp.csv @@ -0,0 +1,33 @@ +TeamID,QB,RB,FB,WR,TE,OL,DL,LB,CB,S,KP,TeamDrill,PositionOverrides +29,film,lift,film,square,square,sled,shed,runfit,hipturn,centerfield,power,team_pass,5248 15005 15255 +25,film,plyometrics,speed,jugs,square,sled,shed,speed,zonedrop,centerfield,power,team_pass, +5,screen,plyometrics,lead,square,square,mirror,shed,zonedrop,zonedrop,centerfield,accuracy,team_pass,244 +1,plyometrics,lift,jugs,jugs,square,mirror,shed,rushlane,jugs,plyometrics,power,lift,15917 +26,dropback,gauntlet,gauntlet,jugs,film,mirror,rip,film,hipturn,plyometrics,power,team_run, +21,speed,gauntlet,gauntlet,square,arc,mirror,rip,rushlane,hipturn,match,accuracy,team_pass,14971 +6,film,gauntlet,lead,jugs,arc,sled,rip,rushlane,hipturn,match,power,team_pass, +7,film,plyometrics,plyometrics,square,square,sled,shed,runfit,hipturn,speed,power,team_pass,33 +17,speed,film,lift,square,blitzpickup,sled,rip,hipturn,zonedrop,centerfield,accuracy,team_pass, +13,dropback,lift,lift,square,arc,sled,shed,runfit,zonedrop,centerfield,power,team_run, +22,dropback,plyometrics,lift,square,square,sled,shed,rushlane,zonedrop,centerfield,accuracy,team_pass, +23,dropback,gauntlet,lead,jugs,square,lift,rip,runfit,zonedrop,film,power,team_pass, +9,film,plyometrics,lead,square,arc,mirror,rip,runfit,jugs,film,power,team_run,15572 +10,dropback,plyometrics,speed,speed,arc,sled,shed,speed,hipturn,centerfield,power,plyometrics,15109 +11,film,speed,lift,speed,speed,lift,shed,runfit,hipturn,alley,power,team_pass, +14,dropback,gauntlet,gauntlet,square,arc,sled,shed,runfit,zonedrop,speed,power,team_pass, +16,plyometrics,plyometrics,plyometrics,plyometrics,arc,sled,rip,runfit,hipturn,centerfield,accuracy,plyometrics, +30,film,gauntlet,blitzpickup,jugs,jugs,mirror,lift,runfit,hipturn,centerfield,power,team_pass,69989 +15,film,plyometrics,blitzpickup,jugs,jugs,mirror,shed,runfit,speed,centerfield,power,team_run,50173 +2,film,gauntlet,jugs,jugs,gauntlet,film,rip,zonedrop,jugs,jugs,power,speed, +24,lift,gauntlet,gauntlet,jugs,square,film,shed,lift,hipturn,lift,power,team_pass, +3,plyometrics,gauntlet,lead,jugs,arc,sled,rip,zonedrop,jugs,centerfield,accuracy,team_pass, +27,film,gauntlet,lead,square,square,mirror,shed,film,hipturn,jugs,accuracy,team_pass,15074 +18,screen,gauntlet,lift,square,plyometrics,lift,lift,film,speed,film,power,film, +4,plyometrics,lift,lift,gauntlet,square,plyometrics,film,film,lift,alley,accuracy,film, +19,dropback,plyometrics,plyometrics,square,arc,sled,lift,speed,speed,speed,power,film, +8,dropback,plyometrics,lift,square,square,sled,shed,zonedrop,zonedrop,match,power,plyometrics,24984 +32,screen,plyometrics,lead,jugs,jugs,mirror,shed,runfit,hipturn,centerfield,accuracy,team_run, +31,film,jugs,blitzpickup,jugs,square,mirror,rip,zonedrop,jugs,match,power,team_pass,10321 +28,film,plyometrics,speed,square,jugs,mirror,rip,rushlane,hipturn,match,power,team_pass, +12,screen,lift,lift,jugs,arc,sled,lift,film,hipturn,jugs,power,team_run,214 204 5234 10347 19974 +20,film,plyometrics,lift,square,square,sled,shed,runfit,hipturn,centerfield,power,team_pass,15241 15685 diff --git a/main.go b/main.go index 72cfa2b..80a6f71 100644 --- a/main.go +++ b/main.go @@ -424,7 +424,7 @@ func handleRequests() http.Handler { apiRouter.HandleFunc("/trades/nfl/proposal/cancel/{proposalID}", controller.CancelTradeOffer).Methods("GET") // Training Camp - // apiRouter.HandleFunc("/nfl/training/camp/{year}", controller.RunTrainingCamps).Methods("GET") + apiRouter.HandleFunc("/nfl/training/camp/{year}", controller.RunTrainingCamps).Methods("GET") // Transfer Intentions apiRouter.HandleFunc("/simfba/sync/transfer/intention", controller.ProcessTransferIntention).Methods("GET") diff --git a/managers/TrainingCampManager.go b/managers/TrainingCampManager.go index 56847c7..a9314a7 100644 --- a/managers/TrainingCampManager.go +++ b/managers/TrainingCampManager.go @@ -149,9 +149,9 @@ func getPositionDrill(drillPosition string, row []string, player structs.NFLPlay return row[2] case "FB": return row[3] - case "TE": - return row[4] case "WR": + return row[4] + case "TE": return row[5] case "OT", "OG", "C": return row[6] @@ -183,12 +183,12 @@ func getEventModifier(player structs.NFLPlayer) int { positive := (.6 * discipline) + negative // Older veterans are more acclimated to the NFL and are less likely to have camp events, positive or negative. - if player.Age > 24 { - negative = negative / 2 - positive = positive / 2 - } else if player.Age > 27 { + if player.Age > 27 { negative = negative / 4 positive = positive / 4 + } else if player.Age > 24 { + negative = negative / 2 + positive = positive / 2 } eventRoll := float32(rand.IntN(100)) @@ -558,17 +558,18 @@ func getAttribute(position string, archetype string, drill string) string { } else if drill == "plyometrics" { return "agility" } else if position == "QB" { - if drill == "dropback" { + switch drill { + case "dropback": return "throw_power" - } else if drill == "screen" { + case "screen": return "throw_accuracy" - } else if strings.Contains(drill, "pass") { + case "team_pass": if archetype == "Pocket" || archetype == "Balanced" { return "throw_power" } else { return "throw_accuracy" } - } else { + default: if archetype == "Pocket" || archetype == "Balanced" { return "throw_accuracy" } else { @@ -576,15 +577,16 @@ func getAttribute(position string, archetype string, drill string) string { } } } else if position == "RB" { - if drill == "gauntlet" { + switch drill { + case "gauntlet": return "carrying" - } else if drill == "square" { + case "square": return "route_running" - } else if drill == "blitzpickup" { + case "blitzpickup": return "pass_block" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if strings.Contains(drill, "pass") { + case "team_pass": switch archetype { case "Speed", "Balanced": return "catching" @@ -593,7 +595,7 @@ func getAttribute(position string, archetype string, drill string) string { default: return "route_running" } - } else { + default: switch archetype { case "Power": return "strength" @@ -608,23 +610,24 @@ func getAttribute(position string, archetype string, drill string) string { } } } else if position == "FB" { - if drill == "gauntlet" { + switch drill { + case "gauntlet": return "carrying" - } else if drill == "square" { + case "square": return "route_running" - } else if drill == "blitzpickup" { + case "blitzpickup": return "pass_block" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if drill == "lead" { + case "lead": return "run_block" - } else if strings.Contains(drill, "pass") { + case "team_pass": if archetype == "Blocking" { return "pass_block" } else { return "catching" } - } else { + default: switch archetype { case "Blocking": return "run_block" @@ -644,17 +647,18 @@ func getAttribute(position string, archetype string, drill string) string { } } } else if position == "TE" { - if drill == "gauntlet" { + switch drill { + case "gauntlet": return "carrying" - } else if drill == "square" { + case "square": return "route_running" - } else if drill == "blitzpickup" { + case "blitzpickup": return "pass_block" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if drill == "arc" { + case "arc": return "run_block" - } else if strings.Contains(drill, "pass") { + case "team_pass": switch archetype { case "Blocking": return "pass_block" @@ -663,19 +667,20 @@ func getAttribute(position string, archetype string, drill string) string { default: return "catching" } - } else { + default: return "run_block" } } else if position == "WR" { - if drill == "gauntlet" { + switch drill { + case "gauntlet": return "carrying" - } else if drill == "square" { + case "square": return "route_running" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if drill == "screenblock" { + case "screenblock": return "run_block" - } else if strings.Contains(drill, "pass") { + case "team_pass": switch archetype { case "Possession", "Red Zone Threat": return "catching" @@ -684,117 +689,126 @@ func getAttribute(position string, archetype string, drill string) string { default: return "route_running" } - } else { + default: return "run_block" } } else if position == "OT" { - if drill == "mirror" { + switch drill { + case "mirror": return "pass_block" - } else if drill == "sled" { + case "sled": return "run_block" - } else if strings.Contains(drill, "pass") { + case "team_pass": return "pass_block" - } else { + default: return "run_block" } } else if position == "OG" { - if drill == "mirror" { + switch drill { + case "mirror": return "pass_block" - } else if drill == "sled" { + case "sled": return "run_block" - } else if strings.Contains(drill, "pass") { + case "team_pass": return "pass_block" - } else { + default: return "run_block" } } else if position == "C" { - if drill == "mirror" { + switch drill { + case "mirror": return "pass_block" - } else if drill == "sled" { + case "sled": return "run_block" - } else if strings.Contains(drill, "pass") { + case "team_pass": return "pass_block" - } else { + default: return "run_block" } } else if position == "DT" { - if drill == "rip" { + switch drill { + case "rip": return "pass_rush" - } else if drill == "shed" { + case "shed": return "run_defense" - } else if strings.Contains(drill, "pass") { + case "team_pass": return "pass_rush" - } else { + default: return "run_defense" } } else if position == "DE" { - if drill == "rip" { + switch drill { + case "rip": return "pass_rush" - } else if drill == "shed" { + case "shed": return "run_defense" - } else if strings.Contains(drill, "pass") { + case "team_pass": return "pass_rush" - } else { + default: return "run_defense" } } else if position == "OLB" { // EDGE if archetype == "Pass Rush" || archetype == "Run Stopper" { - if drill == "rip" { + switch drill { + case "rip": return "pass_rush" - } else if drill == "shed" { + case "shed": return "run_defense" - } else if strings.Contains(drill, "pass") { + case "team_pass": return "pass_rush" - } else { + default: return "run_defense" } // Off Ball } else { - if drill == "runfit" { + switch drill { + case "runfit": return "run_defense" - } else if drill == "rushlane" { + case "rushlane": return "pass_rush" - } else if drill == "zonedrop" { + case "zonedrop": return "zone_coverage" - } else if drill == "hipturn" { + case "hipturn": return "man_coverage" - } else if strings.Contains(drill, "pass") { + case "team_pass": chance := rand.IntN(2) if chance == 0 { return "zone_coverage" } return "man_coverage" - } else { + default: return "run_defense" } } } else if position == "ILB" { - if drill == "runfit" { + switch drill { + case "runfit": return "run_defense" - } else if drill == "rushlane" { + case "rushlane": return "pass_rush" - } else if drill == "zonedrop" { + case "zonedrop": return "zone_coverage" - } else if drill == "hipturn" { + case "hipturn": return "man_coverage" - } else if strings.Contains(drill, "pass") { + case "team_pass": chance := rand.IntN(2) if chance == 0 { return "zone_coverage" } return "man_coverage" - } else { + default: return "run_defense" } } else if position == "CB" { - if drill == "zonedrop" { + switch drill { + case "zonedrop": return "zone_coverage" - } else if drill == "hipturn" { + case "hipturn": return "man_coverage" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if strings.Contains(drill, "pass") { + case "team_pass": switch archetype { case "Man Coverage": return "man_coverage" @@ -807,21 +821,22 @@ func getAttribute(position string, archetype string, drill string) string { } return "man_coverage" } - } else { + default: return "tackle" } } else if position == "FS" { - if drill == "centerfield" { + switch drill { + case "centerfield": return "zone_coverage" - } else if drill == "match" { + case "match": return "man_coverage" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if drill == "alley" { + case "alley": return "run_defense" - } else if drill == "handcombat" { + case "handcombat": return "pass_rush" - } else if strings.Contains(drill, "pass") { + case "team_pass": switch archetype { case "Man Coverage": return "man_coverage" @@ -834,21 +849,22 @@ func getAttribute(position string, archetype string, drill string) string { } return "man_coverage" } - } else { + default: return "tackle" } } else if position == "SS" { - if drill == "centerfield" { + switch drill { + case "centerfield": return "zone_coverage" - } else if drill == "match" { + case "match": return "man_coverage" - } else if drill == "jugs" { + case "jugs": return "catching" - } else if drill == "alley" { + case "alley": return "run_defense" - } else if drill == "handcombat" { + case "handcombat": return "pass_rush" - } else if strings.Contains(drill, "pass") { + case "team_pass": switch archetype { case "Man Coverage": return "man_coverage" @@ -861,7 +877,7 @@ func getAttribute(position string, archetype string, drill string) string { } return "man_coverage" } - } else { + default: return "tackle" } }