-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #549 from EarthCow/get-position-placeholders
Adds placeholders to get current positions
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
20 changes: 20 additions & 0 deletions
20
...booksaw/betterTeams/integrations/placeholder/provider/PositionBalPlaceholderProvider.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.booksaw.betterTeams.integrations.placeholder.provider; | ||
|
||
import com.booksaw.betterTeams.Team; | ||
import com.booksaw.betterTeams.integrations.placeholder.IndividualTeamPlaceholderProvider; | ||
import org.apache.commons.lang.ArrayUtils; | ||
|
||
public class PositionBalPlaceholderProvider implements IndividualTeamPlaceholderProvider { | ||
|
||
@Override | ||
public String getPlaceholderForTeam(Team team) { | ||
|
||
String[] teamsByBalance = Team.getTeamManager().sortTeamsByBalance(); | ||
|
||
int balPosition = ArrayUtils.indexOf(teamsByBalance, team.getName()) + 1; | ||
|
||
return balPosition + ""; | ||
|
||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...saw/betterTeams/integrations/placeholder/provider/PositionMembersPlaceholderProvider.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.booksaw.betterTeams.integrations.placeholder.provider; | ||
|
||
import com.booksaw.betterTeams.Team; | ||
import com.booksaw.betterTeams.integrations.placeholder.IndividualTeamPlaceholderProvider; | ||
import org.apache.commons.lang.ArrayUtils; | ||
|
||
public class PositionMembersPlaceholderProvider implements IndividualTeamPlaceholderProvider { | ||
|
||
@Override | ||
public String getPlaceholderForTeam(Team team) { | ||
|
||
String[] teamsByMembers = Team.getTeamManager().sortTeamsByMembers(); | ||
|
||
int membersPosition = ArrayUtils.indexOf(teamsByMembers, team.getName()) + 1; | ||
|
||
return membersPosition + ""; | ||
|
||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...oksaw/betterTeams/integrations/placeholder/provider/PositionScorePlaceholderProvider.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.booksaw.betterTeams.integrations.placeholder.provider; | ||
|
||
import com.booksaw.betterTeams.Team; | ||
import com.booksaw.betterTeams.integrations.placeholder.IndividualTeamPlaceholderProvider; | ||
import org.apache.commons.lang.ArrayUtils; | ||
|
||
public class PositionScorePlaceholderProvider implements IndividualTeamPlaceholderProvider { | ||
|
||
@Override | ||
public String getPlaceholderForTeam(Team team) { | ||
|
||
String[] teamsByScore = Team.getTeamManager().sortTeamsByScore(); | ||
|
||
int scorePosition = ArrayUtils.indexOf(teamsByScore, team.getName()) + 1; | ||
|
||
return scorePosition + ""; | ||
|
||
} | ||
|
||
} |