Skip to content

Project Part 2: CRC Cards

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

Player

Responsibilities Collaborators
Keeps a unique 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 user has scanned

PlayerActivity

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

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
Add a player to the list of Players and updates PlayerDB to reflect the changes PlayerActivity
Ensures that a new Player's username is unique Player
Updates PlayerDB by editing a Player
Delete a player from the list of players and updates PlayerDB to reflect the changes
Gets and keeps the most current values of every Player in the list of Players
Provides LeaderboardActivity with a list of all players queried from PlayerDB
Sorts the list of players by total score
Notifies the Player class to update its values

QRCode

Responsibilities Collaborators

QRCodeEditActivity

Responsibilities Collaborators

QRCodeActivity

Responsibilities Collaborators

QRCodeDB

Responsibilities Collaborators

QRCodeDBConnector

Responsibilities Collaborators

QRCodeController

Responsibilities Collaborators

Geolocation

Responsibilities Collaborators
Keeps the GPS coordinates of a Geolocation

GeolocationActivity

Responsibilities Collaborators

Leaderboard

Responsibilities Collaborators

LeaderboardActivity

Responsibilities Collaborators
Display list of all users based off total score Player
Search bar at top to search by username for other users PlayerController
Display drop down menu of users below search bar after entry of username
each user displayed is clickable

MainActivity

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

Map

Responsibilities Collaborators
Displays a map showing QRCodes near the player's current location Geolocation
Displays markers at QRCode geolocations QRCodeController

Comment

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

Clone this wiki locally