parent
08441acca3
commit
5eb619760c
@ -1,25 +1,39 @@
|
|||||||
package modele
|
package modele
|
||||||
class Game(private val width: Int,private val height: Int) {
|
|
||||||
private val dashBoard: DashBoard = DashBoard(width,height)
|
import android.view.InputQueue
|
||||||
private var currentShape: Shape? = null
|
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
|
private var difficulty: Difficulty = Difficulty.EASY
|
||||||
|
|
||||||
// To get the current difficulty
|
// To get the current difficulty
|
||||||
fun getDifficulty(): Difficulty = this.difficulty
|
fun getDifficulty(): Difficulty = this.difficulty
|
||||||
|
|
||||||
// To get the current shape on the game
|
fun getShape():Shape = this.currentShape
|
||||||
fun getCurrentShape(): Shape? = this.currentShape
|
|
||||||
|
|
||||||
// To set the current shape
|
// To set the current shape
|
||||||
fun setCurrentShape(newCurrentShape: Shape){
|
fun setShape(newCurrentShape:Shape){
|
||||||
this.currentShape = newCurrentShape
|
this.currentShape = newCurrentShape
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getDashbord():DashBoard = this.dashBoard
|
||||||
|
|
||||||
// The start game function
|
// The start game function
|
||||||
|
|
||||||
fun startGame(){
|
fun startGame(){
|
||||||
//this.setCurrentShape(TypeShape.SquareShape)
|
//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