parent
08441acca3
commit
5eb619760c
@ -1,25 +1,39 @@
|
||||
package modele
|
||||
class Game(private val width: Int,private val height: Int) {
|
||||
private val dashBoard: DashBoard = DashBoard(width,height)
|
||||
private var currentShape: Shape? = null
|
||||
|
||||
import android.view.InputQueue
|
||||
import views.ViewsGame
|
||||
|
||||
class Game(private val width: Int,private val height: Int,private val viewGame:ViewsGame) {
|
||||
private val dashBoard: DashBoard = DashBoard(width,height,viewGame)
|
||||
lateinit var currentShape: Shape
|
||||
private var difficulty: Difficulty = Difficulty.EASY
|
||||
|
||||
// To get the current difficulty
|
||||
fun getDifficulty(): Difficulty = this.difficulty
|
||||
|
||||
// To get the current shape on the game
|
||||
fun getCurrentShape(): Shape? = this.currentShape
|
||||
fun getShape():Shape = this.currentShape
|
||||
|
||||
// To set the current shape
|
||||
fun setCurrentShape(newCurrentShape: Shape){
|
||||
fun setShape(newCurrentShape:Shape){
|
||||
this.currentShape = newCurrentShape
|
||||
}
|
||||
|
||||
fun getDashbord():DashBoard = this.dashBoard
|
||||
|
||||
// The start game function
|
||||
|
||||
fun startGame(){
|
||||
//this.setCurrentShape(TypeShape.SquareShape)
|
||||
currentShape = Shape(TypeShape(EnumTypeShape.IShape),Position(1,1))
|
||||
|
||||
dashBoard.addShape(currentShape)
|
||||
currentShape.position = dashBoard.moveRight(currentShape)
|
||||
|
||||
|
||||
println(currentShape.position.getX())
|
||||
println(currentShape.position.getY())
|
||||
|
||||
dashBoard.updateViewGame()
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue