Skip to content

Commit

Permalink
Merge pull request se-edu#57 from warheade/master
Browse files Browse the repository at this point in the history
update to be completely league tracker
  • Loading branch information
warheade authored Mar 30, 2019
2 parents 1cd7013 + 62217d1 commit c8f69cd
Show file tree
Hide file tree
Showing 57 changed files with 1,883 additions and 1,178 deletions.
29 changes: 29 additions & 0 deletions league_tracker.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AddressBook>
<players>
<name>Lionel Messi</name>
<position>RW</position>
<age>30</age>
<salary>200</salary>
<goalsScored>30</goalsScored>
<goalsAssisted>20</goalsAssisted>
<team>FC Barcelona</team>
<country>Argentina</country>
<jerseyNumber>10</jerseyNumber>
<appearance>54</appearance>
<healthStatus>Healthy</healthStatus>
</players>
<players>
<name>Luis Suarez</name>
<position>Striker</position>
<age>32</age>
<salary>200</salary>
<goalsScored>30</goalsScored>
<goalsAssisted>20</goalsAssisted>
<team>FC Barcelona</team>
<country>Uruguay</country>
<jerseyNumber>9</jerseyNumber>
<appearance>54</appearance>
<healthStatus>Healthy</healthStatus>
</players>
</AddressBook>
2 changes: 1 addition & 1 deletion src/seedu/addressbook/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
public class Main extends Application implements Stoppable {

/** Version info of the program. */
public static final String VERSION = "League Tracker - Version 1.2";
public static final String VERSION = "League Tracker - Version 1.3 (first official release)";

private Gui gui;

Expand Down
75 changes: 0 additions & 75 deletions src/seedu/addressbook/commands/AddCommand.java

This file was deleted.

19 changes: 0 additions & 19 deletions src/seedu/addressbook/commands/ClearCommand.java

This file was deleted.

22 changes: 12 additions & 10 deletions src/seedu/addressbook/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
import seedu.addressbook.data.AddressBook;
import seedu.addressbook.data.finance.ReadOnlyFinance;
import seedu.addressbook.data.match.ReadOnlyMatch;
import seedu.addressbook.data.player.ReadOnlyPerson;
import seedu.addressbook.data.player.ReadOnlyPlayer;
import seedu.addressbook.data.team.ReadOnlyTeam;


/**
* Represents an executable command.
*/
public abstract class Command {
protected AddressBook addressBook;
protected List<? extends ReadOnlyPerson> relevantPersons;
protected List<? extends ReadOnlyPlayer> relevantPlayers;
protected List<? extends ReadOnlyMatch> relevantMatches;
protected List<? extends ReadOnlyTeam> relevantTeams;
protected List<? extends ReadOnlyFinance> relevantFinances;
Expand All @@ -34,13 +35,13 @@ protected Command() {
}

/**
* Constructs a feedback message to summarise an operation that displayed a listing of persons.
* Constructs a feedback message to summarise an operation that displayed a listing of players.
*
* @param personsDisplayed used to generate summary
* @param playersDisplayed used to generate summary
* @return summary message for persons displayed
*/
public static String getMessageForPersonListShownSummary(List<? extends ReadOnlyPerson> personsDisplayed) {
return String.format(Messages.MESSAGE_PERSONS_LISTED_OVERVIEW, personsDisplayed.size());
public static String getMessageForPlayerListShownSummary(List<? extends ReadOnlyPlayer> playersDisplayed) {
return String.format(Messages.MESSAGE_PLAYERS_LISTED_OVERVIEW, playersDisplayed.size());
}

/**
Expand Down Expand Up @@ -76,12 +77,12 @@ public CommandResult execute() {
*/

public void setData(AddressBook addressBook,
List<? extends ReadOnlyPerson> relevantPersons,
List<? extends ReadOnlyPlayer> relevantPlayers,
List<? extends ReadOnlyTeam> relevantTeams,
List<? extends ReadOnlyMatch> relevantMatches,
List<? extends ReadOnlyFinance> relevantFinances) {
this.addressBook = addressBook;
this.relevantPersons = relevantPersons;
this.relevantPlayers = relevantPlayers;
this.relevantTeams = relevantTeams;
this.relevantMatches = relevantMatches;
this.relevantFinances = relevantFinances;
Expand All @@ -92,8 +93,9 @@ public void setData(AddressBook addressBook,
*
* @throws IndexOutOfBoundsException if the target index is out of bounds of the last viewed listing
*/
protected ReadOnlyPerson getTargetPerson() throws IndexOutOfBoundsException {
return relevantPersons.get(getTargetIndex() - DISPLAYED_INDEX_OFFSET);

protected ReadOnlyPlayer getTargetPlayer() throws IndexOutOfBoundsException {
return relevantPlayers.get(getTargetIndex() - DISPLAYED_INDEX_OFFSET);
}

protected ReadOnlyMatch getTargetMatch() throws IndexOutOfBoundsException {
Expand Down
16 changes: 8 additions & 8 deletions src/seedu/addressbook/commands/CommandResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import seedu.addressbook.data.finance.ReadOnlyFinance;
import seedu.addressbook.data.match.ReadOnlyMatch;
import seedu.addressbook.data.player.ReadOnlyPerson;
import seedu.addressbook.data.player.ReadOnlyPlayer;
import seedu.addressbook.data.team.ReadOnlyTeam;

/**
Expand All @@ -16,8 +16,8 @@ public class CommandResult {
/** The feedback message to be shown to the user. Contains a description of the execution result */
public final String feedbackToUser;

/** The list of persons that was produced by the command */
private final List<? extends ReadOnlyPerson> relevantPersons;
/** The list of players that was produced by the command */
private final List<? extends ReadOnlyPlayer> relevantPlayers;

/** The list of teams that was produced by the command */
private final List<? extends ReadOnlyTeam> relevantTeams;
Expand All @@ -31,19 +31,19 @@ public class CommandResult {
/** Constructor for result which do not return any list*/
public CommandResult(String feedbackToUser) {
this.feedbackToUser = feedbackToUser;
relevantPersons = null;
relevantPlayers = null;
relevantTeams = null;
relevantMatches = null;
relevantFinances = null;
}

public CommandResult(String feedbackToUser,
List<? extends ReadOnlyPerson> relevantPersons,
List<? extends ReadOnlyPlayer> relevantPlayers,
List<? extends ReadOnlyTeam> relevantTeams,
List<? extends ReadOnlyMatch> relevantMatches,
List<? extends ReadOnlyFinance> relevantFinances) {
this.feedbackToUser = feedbackToUser;
this.relevantPersons = relevantPersons;
this.relevantPlayers = relevantPlayers;
this.relevantTeams = relevantTeams;
this.relevantMatches = relevantMatches;
this.relevantFinances = relevantFinances;
Expand All @@ -53,8 +53,8 @@ public CommandResult(String feedbackToUser,
/**
* Returns list of persons relevant to the command command result, if any.
*/
public Optional<List<? extends ReadOnlyPerson>> getRelevantPersons() {
return Optional.ofNullable(relevantPersons);
public Optional<List<? extends ReadOnlyPlayer>> getRelevantPlayers() {
return Optional.ofNullable(relevantPlayers);
}

/**
Expand Down
8 changes: 7 additions & 1 deletion src/seedu/addressbook/commands/HelpCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
import seedu.addressbook.commands.match.DeleteMatchCommand;
import seedu.addressbook.commands.match.FindMatchCommand;
import seedu.addressbook.commands.match.ListMatchCommand;
import seedu.addressbook.commands.player.AddCommand;
import seedu.addressbook.commands.player.ClearCommand;
import seedu.addressbook.commands.player.DeleteCommand;
import seedu.addressbook.commands.player.FindCommand;
import seedu.addressbook.commands.player.ListCommand;
import seedu.addressbook.commands.player.SortCommand;
import seedu.addressbook.commands.player.ViewAllCommand;
import seedu.addressbook.commands.team.AddTeam;
import seedu.addressbook.commands.team.ClearTeam;
import seedu.addressbook.commands.team.DeleteTeam;
Expand Down Expand Up @@ -36,7 +43,6 @@ public class HelpCommand extends Command {
+ "\n" + ClearTeam.MESSAGE_USAGE
+ "\n" + FindTeam.MESSAGE_USAGE
+ "\n" + ListTeam.MESSAGE_USAGE
+ "\n" + ViewCommand.MESSAGE_USAGE
+ "\n" + ViewAllCommand.MESSAGE_USAGE
+ "\n" + FinanceCommand.MESSAGE_USAGE
+ "\n" + ListFinanceCommand.MESSAGE_USAGE
Expand Down
24 changes: 0 additions & 24 deletions src/seedu/addressbook/commands/ListCommand.java

This file was deleted.

23 changes: 0 additions & 23 deletions src/seedu/addressbook/commands/SortCommand.java

This file was deleted.

41 changes: 0 additions & 41 deletions src/seedu/addressbook/commands/ViewCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public CommandResult execute() {
} catch (IndexOutOfBoundsException ie) {
return new CommandResult(Messages.MESSAGE_INVALID_MATCH_DISPLAYED_INDEX);
} catch (MatchNotFoundException mnfe) {
return new CommandResult(Messages.MESSAGE_MATCH_NOT_IN_ADDRESSBOOK);
return new CommandResult(Messages.MESSAGE_MATCH_NOT_IN_LEAGUE_TRACKER);
}
}

Expand Down
Loading

0 comments on commit c8f69cd

Please sign in to comment.