Skip to content

Project Part 2: CRC Cards

Alex Nguyen edited this page Feb 13, 2023 · 48 revisions

Player

Responsibilities Collaborators
Keeps a username of the Player QRCode
Keeps contact information of the Player
Keeps a score of the Player
Keeps a Player's avatar as an image
Keeps total QR codes scanned by the Player
Keeps list of QRCodes a Player has scanned

PlayerProfileFragment

Responsibilities Collaborators
Displays a list of QR codes a Player has scanned (name and photo of location) Player
Allow players to select a QR code and go to QRCodeActivity QRCode
Displays the Player's highest and lowest scores (through queries from PlayerController) PlayerController
Displays the Player's username and their avatar
Displays buttons that allow the Player to navigate to other pages
Displays buttons that allow players to navigate to other pages

PlayerSignupActivity

Responsibilities Collaborators
Displays text fields for new players to enter their username and contact information PlayerController
Displays a button that sends the inputted username and contact information to PlayerController when clicked AuthenticationController

PlayerLoginActivity

Responsibilities Collaborators
Displays text fields for existing players to login to their account PlayerController
Displays a button to create an account instead AuthenticationController

AuthenticationController

Responsibilities Collaborators
Ensures that a new Player's username is unique Player
Add a player to the list of Players and updates PlayerDB to reflect the changes PlayerSignupActivity
PlayerDB

PlayerDB

Responsibilities Collaborators
Creates a new Player with a username, score (initially 0), avatar, number of QRCodes scanned (initially 0), and a list of QRCodes scanned (initially empty) in the Firebase Firestore database PlayerDBConnector
Reads the values of a Player in the Firebase Firestore database Player
Updates the values of a Player in the Firebase Firestore database
Deletes a Player from the Firebase Firestore database

PlayerDBConnector

Responsibilities Collaborators
Connects to the Firebase Firestore database PlayerDB

PlayerController

Responsibilities Collaborators
Keeps a list of Players PlayerDB
Sorts the list of players by total score or highest scoring QRCode Player
Notifies the Player class to update its values PlayerProfileFragment
Updates PlayerDB by editing a Player
Delete a player from the list of players and updates PlayerDB to reflect the changes
Removes a QRCode from a Player's list of QRCodes scanned and updates PlayerDB to reflect the changes
Gets and keeps the most current values of every Player in the list of Players from PlayerDB
Provides Leaderboard with a sorted list of all players queried from PlayerDB

QRCode

Responsibilities Collaborators
Stores generated hash for the QR code (ID) Player
Stores photo of location Geolocation
Stores list of comments Comment
Stores name of QR code
Stores image/visual representation
Stores no. of points obtained
Stores username of player who first scanned it
Stores geolocation object for QR code

QRCodeEditFragment

Responsibilities Collaborators
Shows option to take a photo of the location Player
Shows option to include geolocation QRCode
Shows option to skip all steps Geolocation
Shows visual representation of QR code QRCodeController
Shows generated name of QR code ScannerFragment
Shows points generated

QRCodeFragment

Responsibilities Collaborators
Shows name of player Player
Shows name of QR code QRCode
Shows points obtained from QR code QRCodeController
Shows delete button if QR code is generated by current user
Shows comments of a QR code
Shows visual representation of QR code

QRCodeDB

Responsibilities Collaborators
Reads the values of a QRCode in the Firebase Firestore database QRCode
Updates the values of a QRCode in the Firebase Firestore database QRCodeDBConnector
Deletes a QRCode from the Firebase Firestore database

QRCodeDBConnector

Responsibilities Collaborators
Connects to the Firebase Firestore database QRCodeDB

QRCodeController

Responsibilities Collaborators
Calculate SHA-256 hash QRCode
Generate unique name for QR code Player
Generate unique visual representation for QR code Comment
Calculate points for QR code QRCodeDB
Calculate no. of players that scan QR code
Link comment to a QR code
Get all comments on a QR code
Delete a QR code scan

ScannerFragment

Responsibilities Collaborators
Display the Player's camera ScannerController
Indicate when a QRCode is detected and allow Players to scan a QRCode
Prompt Players to take a photo of the location of a QRCode
Display buttons that allow Players to accept or decline Geolocation recording
Displays buttons that allow players to navigate to other pages

ScannerController

Responsibilities Collaborators
Validates the scanned QRCode ScannerFragment
Record Geolocation only if Player accepts Geolocation recording
Produces a hash used to score a QRCode
Prompts QRCodeController to create a new QRCode

Geolocation

Responsibilities Collaborators
Keeps the GPS coordinates of a Geolocation

Map

Responsibilities Collaborators
Keeps a representation of a map Geolocation
Keeps a list of nearby QRCodes QRCode
Asks QRCode class for Geolocation of each nearby QRCode

MapFragment

Responsibilities Collaborators
Displays a map showing QRCodes near the Player's current location Map
Displays a search bar to allow Players to search by using geolocation
Displays QRCodes near the Geolocation entered in the search bar
Allows a Player to click on a QRCode on the map to go to QRCodeActivity
Displays buttons that allow players to navigate to other pages

Leaderboard

Responsibilities Collaborators
Keeps a sorted list of Players Player

LeaderboardFragment

Responsibilities Collaborators
Display list of all Players based off total score or highest scoring unique QRCode Player
Each Player displayed is clickable (goes to PlayerActivity) Leaderboard
Search bar at top to search by username for other Players
Display drop down menu of Player below search bar after entry of username
Displays buttons that allow players to navigate to other pages

LeaderboardSearchFragment

Responsibilities Collaborators
Display results of a Player search as a list of Players with usernames containing input in search bar PlayerController
Each Player displayed is clickable (goes to PlayerActivity)
Displays buttons that allow players to navigate to other pages

HomeFragment

Responsibilities Collaborators
Displays a button that allows players to scan QRCodes (goes to ScannerActivity)
Displays buttons that allow players to navigate to other pages

Comment

Responsibilities Collaborators
Keeps the author of the comment (a player) Player
Keeps the text of the comment
Keeps the date of the comment

TwoNavMainActivity

Responsibilities Collaborators
Gives the user an option to switch between 2 tabs HomeFragment

FourNavMainActivity

Responsibilities Collaborators
Gives the user an option to switch between 4 tabs HomeFragment
LeaderboardFragment
MapFragment
PlayerProfileFragment

Clone this wiki locally