Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ranking system #24

Merged
merged 27 commits into from
Dec 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1c69232
#12: Persist the lock to database.
javydreamercsw Dec 1, 2018
17b37c7
#12: Allow to lock from UI. Disable/enable buttons based on lock state.
javydreamercsw Dec 1, 2018
c2a916c
Merge origin/ranking-system into ranking-system
javydreamercsw Dec 1, 2018
8a1d90e
#20: Implement database side.
javydreamercsw Dec 2, 2018
7f6b3dc
#19: Implement UI side.
javydreamercsw Dec 2, 2018
ba348cc
Add more test coverage.
javydreamercsw Dec 3, 2018
a946b9a
Fix due to changes in database classes.
javydreamercsw Dec 3, 2018
d6cc351
Include JaCoCo coverage.
javydreamercsw Dec 3, 2018
0f3dbe8
Ignore test coverage on generated code.
javydreamercsw Dec 3, 2018
ab3974d
#6: Add tournament format.
javydreamercsw Dec 3, 2018
b3a9f97
Separate into single and double elimination formats.
javydreamercsw Dec 4, 2018
f8cbf1e
Import fail instead of the bogus local method created by mistake.
javydreamercsw Dec 4, 2018
766b57f
Change some messages and log levels.
javydreamercsw Dec 4, 2018
b65964d
Randomize ranked/unranked matches.
javydreamercsw Dec 4, 2018
767d66f
New method to set a match ranked/unranked.
javydreamercsw Dec 4, 2018
949cdb9
Use service method instead.
javydreamercsw Dec 4, 2018
8472015
If not using demo, load normally.
javydreamercsw Dec 4, 2018
31274cc
#6: Add round pairing functionality.
javydreamercsw Dec 6, 2018
a77cbd9
Fix test that was falsely passing because data was loaded in the setup
javydreamercsw Dec 10, 2018
6263b04
#22: Add Round time limit settings
javydreamercsw Dec 10, 2018
4f2fdb6
Database changes for tournament features.
Dec 19, 2018
e536c8d
1) Work to add tournament settings to UI. The time controls are not r…
Dec 19, 2018
ace0a45
Add mean and standard deviation attributes for team.
Dec 26, 2018
221dc17
Process and update rankings when a result is processed.
Dec 26, 2018
2dd2796
Add ranking points
Dec 29, 2018
51fba71
Add JaCoCo coverage
Dec 29, 2018
e90b5d0
Merge branch 'master' into ranking-system
javydreamercsw Dec 29, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/Database-Storage/target/
/TrueSkill/target/
/TournamentManagerWeb/target/
/MTG/target/
/MTG/target/
/target/
Binary file modified Database-Storage/DB.mwb
Binary file not shown.
Binary file modified Database-Storage/DB.mwb.bak
Binary file not shown.
6 changes: 6 additions & 0 deletions Database-Storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@
<version>2.3.1</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ public class Format implements Serializable
@Size(max = 255)
@Column(name = "description")
private String description;
private static final long serialVersionUID = 1L;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "format")
private List<TeamHasFormatRecord> teamHasFormatRecordList;
private static final long serialVersionUID = -6764484082819653225L;
@EmbeddedId
protected FormatPK formatPK;
@JoinColumn(name = "game_id", referencedColumnName = "id", insertable = false,
Expand All @@ -53,6 +55,8 @@ public class Format implements Serializable
private Game game;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "format")
private List<MatchEntry> matchEntryList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "format")
private List<Tournament> tournamentList;

public Format()
{
Expand Down Expand Up @@ -105,6 +109,17 @@ public void setMatchEntryList(List<MatchEntry> matchEntryList)
this.matchEntryList = matchEntryList;
}

@XmlTransient
public List<Tournament> getTournamentList()
{
return tournamentList;
}

public void setTournamentList(List<Tournament> tournamentList)
{
this.tournamentList = tournamentList;
}

@Override
public int hashCode()
{
Expand All @@ -129,8 +144,40 @@ public boolean equals(Object object)
@Override
public String toString()
{
return "com.github.javydreamercsw.database.storage.db.Format[ formatPK=" +
formatPK + " ]";
return "com.github.javydreamercsw.database.storage.db.Format[ formatPK="
+ formatPK + " ]";
}


@XmlTransient
public List<TeamHasFormatRecord> getTeamHasFormatRecordList()
{
return teamHasFormatRecordList;
}

public void setTeamHasFormatRecordList(List<TeamHasFormatRecord> teamHasFormatRecordList)
{
this.teamHasFormatRecordList = teamHasFormatRecordList;
}

public String getName()
{
return name;
}

public void setName(String name)
{
this.name = name;
}

public String getDescription()
{
return description;
}

public void setDescription(String description)
{
this.description = description;
}

public String getName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@
})
public class Game implements Serializable
{
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "name")
private String name;
@Size(max = 255)
@Column(name = "description")
private String description;
private static final long serialVersionUID = -6267533299417173163L;
@Id
@Basic(optional = false)
Expand All @@ -48,14 +56,6 @@ public class Game implements Serializable
initialValue = 1)
@Column(name = "id")
private Integer id;
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 45)
@Column(name = "name")
private String name;
@Size(max = 255)
@Column(name = "description")
private String description;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "game")
private List<Format> formatList;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "game")
Expand All @@ -80,25 +80,6 @@ public void setId(Integer id)
this.id = id;
}

public String getName()
{
return name;
}

public void setName(String name)
{
this.name = name;
}

public String getDescription()
{
return description;
}

public void setDescription(String description)
{
this.description = description;
}

@XmlTransient
public List<Format> getFormatList()
Expand Down Expand Up @@ -148,4 +129,24 @@ public void setRecordList(List<Record> recordList)
{
this.recordList = recordList;
}

public String getName()
{
return name;
}

public void setName(String name)
{
this.name = name;
}

public String getDescription()
{
return description;
}

public void setDescription(String description)
{
this.description = description;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,23 @@ public String toString()
+ matchResultPK + " ]";
}

public boolean getLocked()
public boolean getRanked()
{
return locked;
return ranked;
}

public void setLocked(boolean locked)
public void setRanked(boolean ranked)
{
this.locked = locked;
this.ranked = ranked;
}

public boolean getRanked()
public boolean getLocked()
{
return ranked;
return locked;
}

public void setRanked(boolean ranked)
public void setLocked(boolean locked)
{
this.ranked = ranked;
this.locked = locked;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
})
public class Record implements Serializable
{
private static final long serialVersionUID = -893880954416960217L;
@EmbeddedId
protected RecordPK recordPK;
@Basic(optional = false)
@NotNull
@Column(name = "wins")
Expand Down Expand Up @@ -65,9 +68,6 @@ public class Record implements Serializable
})
@ManyToMany
private List<TournamentHasTeam> tournamentHasTeamList;
private static final long serialVersionUID = 1L;
@EmbeddedId
protected RecordPK recordPK;
@JoinColumn(name = "game_id", referencedColumnName = "id", insertable = false,
updatable = false)
@ManyToOne(optional = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

Expand All @@ -33,12 +37,22 @@ public class Round implements Serializable
private static final long serialVersionUID = 1L;
@EmbeddedId
protected RoundPK roundPK;
@JoinColumn(name = "tournament_id", referencedColumnName = "id",
insertable = false, updatable = false)
@JoinColumns(
{
@JoinColumn(name = "tournament_id", referencedColumnName = "id",
insertable = false, updatable = false),
@JoinColumn(name = "tournament_tournament_format_id",
referencedColumnName = "tournament_format_id",
insertable = false, updatable = false)
})
@ManyToOne(optional = false)
private Tournament tournament;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "round")
private List<MatchEntry> matchEntryList;
@Basic(optional = false)
@NotNull
@Column(name = "roundNumber")
private int roundNumber;

public Round()
{
Expand Down Expand Up @@ -103,7 +117,7 @@ public boolean equals(Object object)
return false;
}
Round other = (Round) object;
return !((this.roundPK == null && other.roundPK != null)
return !((this.roundPK == null && other.roundPK != null)
|| (this.roundPK != null && !this.roundPK.equals(other.roundPK)));
}

Expand All @@ -113,4 +127,14 @@ public String toString()
return "com.github.javydreamercsw.database.storage.db.Round[ roundPK="
+ roundPK + " ]";
}

public int getRoundNumber()
{
return roundNumber;
}

public void setRoundNumber(int roundNumber)
{
this.roundNumber = roundNumber;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class Team implements Serializable
@Size(max = 245)
@Column(name = "name")
private String name;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "team")
private List<TeamHasFormatRecord> teamHasFormatRecordList;
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
Expand All @@ -61,6 +63,7 @@ public Team()
matchHasTeamList = new ArrayList<>();
playerList = new ArrayList<>();
tournamentHasTeamList = new ArrayList<>();
teamHasFormatRecordList = new ArrayList<>();
}

public Team(String name)
Expand All @@ -79,7 +82,6 @@ public void setId(Integer id)
this.id = id;
}


@XmlTransient
public List<Player> getPlayerList()
{
Expand Down Expand Up @@ -140,6 +142,17 @@ public String toString()
return "com.github.javydreamercsw.database.storage.db.Team[ id=" + id + " ]";
}

@XmlTransient
public List<TeamHasFormatRecord> getTeamHasFormatRecordList()
{
return teamHasFormatRecordList;
}

public void setTeamHasFormatRecordList(List<TeamHasFormatRecord> teamHasFormatRecordList)
{
this.teamHasFormatRecordList = teamHasFormatRecordList;
}

public String getName()
{
return name;
Expand Down
Loading