-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from tungnk123/feature/playing_room
Feature/playing room
- Loading branch information
Showing
34 changed files
with
1,996 additions
and
254 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 27 additions & 1 deletion
28
app/src/main/java/com/example/chiecnonkydieu/data/DataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
package com.example.chiecnonkydieu.data | ||
|
||
import rubikstudio.library.model.LuckyItem | ||
import com.example.chiecnonkydieu.model.QuestionAnswer | ||
import com.google.firebase.database.DatabaseReference | ||
import com.google.firebase.database.ktx.database | ||
import com.google.firebase.ktx.Firebase | ||
|
||
|
||
val database: DatabaseReference = Firebase.database.reference | ||
const val REFERENCE_CAUHOI = "CAU HOI" | ||
val questionAnswerList: MutableList<QuestionAnswer> = mutableListOf( | ||
QuestionAnswer( | ||
"Hà Nội", | ||
"HA NOI", | ||
"Thủ đô của Việt Nam nằm ở đâu?", | ||
"Hint1", | ||
"Hint2", | ||
"Hint3", | ||
"Thong tin" | ||
), | ||
QuestionAnswer( | ||
"Hà Nội", | ||
"HA NOI", | ||
"Thủ đô của Việt Nam nằm ở đâu?", | ||
"Hint1", | ||
"Hint2", | ||
"Hint3", | ||
"Thong tin" | ||
), | ||
|
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 12 additions & 6 deletions
18
app/src/main/java/com/example/chiecnonkydieu/data/GameModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,29 @@ | ||
package com.example.chiecnonkydieu.data | ||
|
||
import android.health.connect.datatypes.units.Length | ||
import com.example.chiecnonkydieu.model.LetterCard | ||
import com.example.chiecnonkydieu.model.Player | ||
import com.example.chiecnonkydieu.model.QuestionAnswer | ||
|
||
data class GameModel( | ||
val gameId: Int = -1, | ||
val winner: String = "", | ||
var gameStatus: GameStatus = GameStatus.CREATED, | ||
val playersList: MutableList<Player> = mutableListOf<Player>(), | ||
val currentPlayer: Player = Player(), | ||
val currentQuestion: String = "", | ||
val currentAnswer: String = "HA NOI", | ||
val currentGuess: String = " A N " | ||
|
||
var currentPlayer: Player = Player(), | ||
var currentQuestionAnswer: QuestionAnswer = questionAnswerList[0], | ||
val guessesCharacters: MutableList<String> = mutableListOf(), | ||
var letterCardList: MutableList<LetterCard> = mutableListOf(), | ||
val previousQuestionAnswers: MutableList<QuestionAnswer> = mutableListOf(), | ||
var currentSpinValue: String = "" | ||
) | ||
|
||
enum class GameStatus { | ||
CREATED, | ||
JOINED1, | ||
JOINED2, | ||
INPROGRESS, | ||
GUESS, | ||
ENDROUND, | ||
WAITING_TO_CONTINUE, | ||
FINISHED | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.chiecnonkydieu.model | ||
|
||
data class Hint( | ||
val title: String = "Đây là hint", | ||
val isOpen: Boolean = false | ||
) |
6 changes: 6 additions & 0 deletions
6
app/src/main/java/com/example/chiecnonkydieu/model/LetterCard.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.example.chiecnonkydieu.model | ||
|
||
data class LetterCard( | ||
val letter: String = "A", | ||
var isHidden: Boolean = letter != " " | ||
) |
4 changes: 2 additions & 2 deletions
4
...com/example/chiecnonkydieu/data/Player.kt → ...om/example/chiecnonkydieu/model/Player.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.example.chiecnonkydieu.data | ||
package com.example.chiecnonkydieu.model | ||
|
||
data class Player( | ||
val name: String = "Player", | ||
val gender: Boolean = true, | ||
val score: Int = 0 | ||
var score: Int = 0 | ||
) |
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/example/chiecnonkydieu/model/QuestionAnswer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example.chiecnonkydieu.model | ||
|
||
|
||
data class QuestionAnswer( | ||
var DoiTuong : String = "", | ||
var DoiTuongInHoa : String = "", | ||
var CauHoi : String = "", | ||
var Hint1 : String = "", | ||
var Hint2 : String = "", | ||
var Hint3 : String = "", | ||
var ThongTin : String = "" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.