% template FreeAgencySvc(starwave.webgames.minigame.challenge.services.FreeAgencySvc obj) context = obj.minigameContext challenge = obj.challenge %> <% start = 0 end = 0 if (obj.availablePlayers != null) { start = 0 end = 29 if (obj.availablePlayers.length - 1 < 29) { end = obj.availablePlayers.length - 1 } if (obj.currentRequest.args["page"] == "2") { start = 30 if (obj.availablePlayers.length - 1 < 59) { end = obj.availablePlayers.length - 1 } else { end = 59 } } if (obj.currentRequest.args["page"] == "3") { start = 60 if (obj.availablePlayers.length - 1 < 89) { end = obj.availablePlayers.length - 1 } else { end = 89 } } else if (obj.currentRequest.args["page"] == "4") { start = 90 end = obj.availablePlayers.length - 1 } } position_lookup_singular = ##(0, "Point Guard", 1, "Shooting Guard", 2, "Small Forward", 3, "Power Forward", 4, "Center", 5, "Coach") position_lookup_abbrev = ##(0, "PG", 1, "SG", 2, "SF", 3, "PF", 4, "C", 5, "Coach") budget = challenge.entryBudget // Calculate different averages, totals and values roster = obj.roster rosterAtPos = obj.entryPlayersAt ap = obj.availablePlayers currentSalary = 0.0 openSlots = 0 // Count open slots foreach (item in roster) { if (item == null) { openSlots = openSlots + 1} if (item != null) { // This will enable us to avoid another call to DB currentSalary = currentSalary + item.lockedSalary } } cashLeft = budget - currentSalary; //slotsLeft = openSlots + rosterAtPos.length avgSalary = 0.0 slotsFilled = roster.length - openSlots slotsLeft = roster.length - slotsFilled if (roster.length > 0 and slotsFilled != 0) { avgSalary = currentSalary / (slotsFilled) } if (slotsLeft != 0) { avgLeft = cashLeft / slotsLeft } else { avgLeft = cashLeft } %>
| Select Your <% challenge.positions[obj.positionID].name %> | |
|
<% EntryHeader(context) %> |
Group Directory |
<% numberFormat("#.0") %>
| Balance Sheet | Rules for Selecting Players | ||
|
Starting: Spent: Available: |
80.0 (13.33/player) <% if (currentSalary > challenge.entryBudget + 0.00000000000001) { '' } else { currentSalary } %> (<% avgSalary %>/player) <% cashLeft %> (<% avgLeft %>/player) |
Staying under the <%challenge.entryBudget%> point limit, select one player from each position. To add a new player, click the radio button next to the player's name and click the "Select" button at the bottom of the page. This will automatically add that player and drop your existing player at that position. For more information see How to Play. | |