Part 2: CRC Cards - CMPUT301W23T21/QR-Project GitHub Wiki
A high-level overview of the main classes and their responsibilities in the QR code hunting app using CRC cards.
QRCodeScanner
Responsibilities | Collaborators |
---|---|
Scan and recognize QR codes and barcodes | PlayerAccount |
Hash the scanned code and score it based on a scoring system | ScoringSystem |
Take a photo of the scanned object | Map |
Record geolocation of the scanned code | |
Add the score and the hash of the scanned code to the player's account |
QRCode
Responsibilities | Collaborators |
---|---|
Contains a Hash object, photo with geolocation, and name of the QRCode | Scanner |
Stores the players who scanned it | Player |
Stores the photo with geolocation | Photo |
Hash |
Hash
Responsibilities | Collaborators |
---|---|
Contains hashed string | QRCode |
Calculates score from hashed string based on some rule |
Photo
Responsibilies | Collaborators |
---|---|
Stores geolocation of the QR Code internally | QRCode |
Shows the whereabouts of the QR Code | Scanner |
Player
PlayerAccount
Responsibilities | Collaborators |
---|---|
Store player's information, including the total score, scanned QR codes, and photos | QRCodeScanner |
Store the hash of the scanned QR codes to avoid duplicates | Map |
Provide a summary of the player's activity, including the highest-scoring QR codes, the number of QR codes, and the total score |
PlayersDB
Responsibilities | Collaborators |
---|---|
Maintaining player entities | PlayerAccount |
Performing actions: edit, delete player info etc | PlayerDBConnector |
PlayerDBConnector
Responsibilities | Collaborators |
---|---|
Connects to the Firebase Firestore database | PlayerDB |
Scoring
ScoringSystem
Responsibilities | Collaborators |
---|---|
Score the QR codes based on certain properties like hex digits | QRCodeScanner |
Provide a score for each scanned QR code | PlayerAccount |
Store a record of the scores of all scanned QR codes |
ScoreDB
Responsibilities | Collaborators |
---|---|
Maintains the score of a particular player in DB | ScoringSystem |
ScoreDBConnector |
ScoreDBConnector
Responsibilities | Collaborators |
---|---|
Connects to the Firebase Firestore database | ScoreDB |
Map
Responsibilities | Collaborators |
---|---|
Show the location of the scanned QR codes on a map | PlayerAccount |
Show other players' activity, including their scanned QR codes and photos | Photo |
Allow players to search for QR codes in a certain region |