You will create an application for keeping track of video game players, what games they play, their activity in those games, and friendships between players. The application will also compile some of these data sources to output informative reports. This application will be similar in nature to Valve's Steam service or the website trueVictorys.com.
The application will be implemented as a command-line-interface (CLI) application. All input will be taken from standard input. The input contains multiple lines. Each non-empty line of input will begin with a command that identifies the type of operation that line describes, followed by all its arguments (if any). The input can also contain empty lines, or lines in which there are only whitespace characters. Your program should ignore these empty or empty-character-only lines.
All output will be written to standard out.
The possible line formats are:
AddPlayer <Player ID> <Player Name>
Add player to the data structures. <Player ID> is a positive integer identifier for the player. <Player Name> is a string enclosed by double quotes ("Andruid Kerne"). <Player Name> may contain special characters (excluding double quote).
AddGame <Game ID> <Game Name>
Add game to the data structures. <Game ID> is a positive integer identifier for the game. <Game Name> is a string enclosed by double quotes (i.e. "Mirror's Edge"). <Game Name> may contain special characters (excluding double quote).
AddVictory <Game ID> <Victory ID> <Victory Name> <Victory Points>
Add Victory to the game denoted by <Game ID>. <Victory ID> is an integer identifier for the Victory. <Victory Name> is a string enclosed by double quotes (i.e. "Head over heels"). <Victory Name> may contain special characters (excluding double quote). <Victory Points> is an integer indicating how many gamer points the Victory is worth.
Plays <Player ID> <Game ID> <Player IGN>
Add entry for player playing a specific game. <Player IGN> is a string identifier for that player's particular in game name for the specified game, enclosed by double quotes. <Player IGN> may contain special characters (excluding double quote).
AddFriends <Player ID1> <Player ID2>
Makes players 1 & 2 friends. Friends are mutual.
WinVictory <Player ID> <Game ID> <Victory ID>
Adds Victory indicated to <Player ID>'s record. Each Victory can only be achieved by a given player for once.
FriendsWhoPlay <Player ID> <Game ID>
Report which of player's friends play the specified game.
ComparePlayers <Player ID1> <Player ID2> <Game ID>
Print report comparing player 1 and player 2's Victory records and total Victory scores for the given game. The given game is guaranteed to have been played by both players.
SummarizePlayer <Player ID>
Print record of all of player's friends, games the player plays, and gamer point totals.
SummarizeGame <Game ID>
Print a record of all players who play the specified game and the number of times each of its victories have been accomplished.
SummarizeVictory <Game ID> <Victory ID>
Print a list of all players who have achieved a Victory, and the percentage of players who play that game who have the Victory.
VictoryRanking
Print a summary ranking all players by their total number of gamer points.
Players, Games, Victories and data relationships are guaranteed to exist before being operated on. IDs are guaranteed to be unique within their scope (i.e. a game's Victories will all have mutually exclusive IDs, but different games may have Victories with the same ID). Note that names can contain spaces and special characters (excluding double quote). The input has been validated to make sure that each non-empty line conforms to one of the specified line formats.
Here is an sample input:
AddGame 4001 "Mirror's Edge"
AddGame 4002 "Dark Souls"
AddGame 4003 "Dishonored"
AddGame 4004 "Deadlight"
AddGame 4005 "League of Legends"
AddVictory 4001 901 "Access all areas" 20
AddVictory 4001 902 "Tango down" 15
AddVictory 4001 903 "Mine!" 15
AddVictory 4001 904 "Packrat" 80
AddVictory 4001 905 "Tango down" 20
AddVictory 4001 906 "Pro runner" 50
AddVictory 4001 907 "Crystal Weapon" 15
AddVictory 4002 801 "Prayer of a Maiden" 25
AddVictory 4002 802 "Dark Lord" 90
AddVictory 4003 701 "Faceless" 20
AddVictory 4003 702 "Resolution" 100
AddVictory 4003 703 "Surgical" 30
AddVictory 4003 704 "Tempest" 20
AddVictory 4004 601 "Go back to hell" 10
AddVictory 4004 602 "I want it all" 30
AddVictory 4005 501 "Double kill" 20
AddVictory 4005 502 "Penta kill" 50
AddPlayer 40001 "Bill Hamilton"
AddPlayer 40002 "Andruid Kerne"
AddPlayer 40003 "Andrew Webb"
AddPlayer 40004 "Nic Lupfer"
AddPlayer 40005 "Lennart Nacke"
AddFriends 40001 40002
AddFriends 40001 40003
AddFriends 40001 40004
AddFriends 40001 40005
AddFriends 40002 40003
AddFriends 40002 40004
AddFriends 40004 40005
Plays 40001 4001 "FaithRunner1337"
Plays 40001 4002 "AmazingAchievosAhead"
Plays 40001 4003 "Splinez"
Plays 40001 4004 "ApocalypticJumper666"
Plays 40001 4005 "Splinez"
Plays 40002 4001 "andruid"
Plays 40002 4002 "andruid"
Plays 40002 4003 "andruid"
Plays 40002 4004 "andruid"
Plays 40002 4005 "andruid"
Plays 40003 4001 "amw"
Plays 40003 4002 "messi"
Plays 40003 4003 "kaka"
Plays 40003 4004 "foobar"
Plays 40003 4005 "no9"
Plays 40004 4001 "thenic"
Plays 40004 4002 "omgnic"
Plays 40004 4003 "thenic"
Plays 40004 4004 "omgnic"
Plays 40004 4005 "nic"
WinVictory 40001 4001 901
WinVictory 40001 4001 902
WinVictory 40001 4001 903
WinVictory 40001 4001 904
WinVictory 40001 4001 905
WinVictory 40001 4001 906
WinVictory 40001 4001 907
WinVictory 40001 4002 801
WinVictory 40001 4002 802
WinVictory 40001 4003 701
WinVictory 40001 4003 702
WinVictory 40001 4004 601
WinVictory 40002 4001 901
WinVictory 40002 4002 801
WinVictory 40002 4003 701
WinVictory 40002 4004 601
WinVictory 40003 4001 901
WinVictory 40003 4001 902
WinVictory 40003 4002 801
WinVictory 40003 4002 802
WinVictory 40003 4003 701
WinVictory 40003 4003 702
WinVictory 40003 4004 601
WinVictory 40003 4004 602
WinVictory 40004 4001 901
WinVictory 40004 4002 801
WinVictory 40004 4003 702
WinVictory 40004 4004 601
WinVictory 40004 4005 501
WinVictory 40004 4005 502
SummarizePlayer 40001
Since your program reads commands from the command line, you can run your program and type in the above list of commands to see if it works. Alternatively, you can save the above list into a text file (e.g. commands.txt) and use redirection (explanation for *nix and windows) to send the content of that file to the standard input of your program:
$ my_program < commands.txt
The reports should be well formatted to facilitate making sense of the output data. You should use human friendly names, rather than IDs, in your report. For example, the above list of commands may result in the following output:
Player: Bill Hamilton
Total Gamerscore: 460 pts
Game Victories Gamerscore IGN
------------------------------------------------------------------------------
1. Mirror's Edge 7/7 215 pts FaithRunner1337
2. Dark Souls 2/2 115 pts AmazingAchievosAhead
3. Dishonored 2/4 120 pts Splinez
4. Deadlight 1/2 10 pts ApocalypticJumper666
5. League of Legends 0/2 0 pts Splinez
Friend Gamerscore
---------------------------------------
1. Andrew Webb 310 pts
2. Nic Lupfer 225 pts
3. Andruid Kerne 75 pts
4. Lennart Nacke 0 pts
Use this form to submit the URL to your GitHub repository for the individual assignment. Make sure that the master branch contains latest, complete code. Your code must be able to compile from the university unix. To test this, use SSH on your_net_id@compute.cs.tamu.edu and compile from there. We will not compile your code in Visual Studio. Provide a Makefile, a solution/project file, a build script, or a README file containing instructions, to help build the final executable.
45% of the grade will depend on how well the code works, including how well the output is organized to facilitate understanding, and the implementation of the functionality described. The remaining 55% will be based on how well you have done with naming, style, and commenting in the code.