Class Wallet
- java.lang.Object
-
- com.project.lordofthewings.Models.Wallet.Wallet
-
public class Wallet extends java.lang.ObjectClass to model a Player's Wallet in the game. Purpose of the Wallet is to hold the QRCodes that the player has collected throughout. Issues: Pending integration for some of the methods
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddQRCode(QRCode qr, java.lang.String lat, java.lang.String lon, java.lang.String comment)Adds a QR code to the walletvoiddeleteQRCode(QRCode qr)Deletes a QR code from the users wallet, updates relevant info afterwardsintgetInitialQRCodeCount()Allows us to get the users total QR codes scanned from previous runs of the appintgetInitialScore()Allows us to get the total score of the QR codes scanned from previous runs of the app by the playerjava.util.ArrayList<QRCode>getQrCodes()getter for the player's scanned QR codesintgetQrCodesCount()getter for the player's scanned QR codes countintgetScore()getter for the player scorejava.lang.StringgetUsername()booleanhaveQRCode(QRCode qr)Checks whether the user has already scanned the QR code
-
-
-
Constructor Detail
-
Wallet
public Wallet(java.lang.String user, java.util.ArrayList<QRCode> qrCodes, int score, com.google.firebase.firestore.FirebaseFirestore db)Constructor for the Wallet class- Parameters:
user- the username of the userqrCodes- the list of QR codes that the user has collectedscore- the score of the user
-
-
Method Detail
-
getUsername
public java.lang.String getUsername()
-
addQRCode
public void addQRCode(QRCode qr, java.lang.String lat, java.lang.String lon, java.lang.String comment)
Adds a QR code to the wallet- Parameters:
qr- the QRCode Object to be addedlat- the latitude of the location where the QR code was scannedlon- the longitude of the location where the QR code was scanned
-
deleteQRCode
public void deleteQRCode(QRCode qr)
Deletes a QR code from the users wallet, updates relevant info afterwards- Parameters:
qr- the QR code object that is to be deleted
-
getInitialQRCodeCount
public int getInitialQRCodeCount()
Allows us to get the users total QR codes scanned from previous runs of the app- Returns:
- the total number of QR codes the player has scanned
-
getInitialScore
public int getInitialScore()
Allows us to get the total score of the QR codes scanned from previous runs of the app by the player- Returns:
- the total score of the QR codes the player has scanned
-
getScore
public int getScore()
getter for the player score- Returns:
- the players score
-
getQrCodesCount
public int getQrCodesCount()
getter for the player's scanned QR codes count- Returns:
- the number of scanned QRCodes
-
getQrCodes
public java.util.ArrayList<QRCode> getQrCodes()
getter for the player's scanned QR codes- Returns:
- list of scanned QRCode objects
-
haveQRCode
public boolean haveQRCode(QRCode qr)
Checks whether the user has already scanned the QR code- Parameters:
qr- the QR object to verify- Returns:
- boolean based on result
-
-