Skip to content

Commit

Permalink
refactor: 移动软件包
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim-shop committed May 10, 2023
1 parent 7c971f6 commit e6a4d10
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package net.imshit.aircraftwar.element.bullet

import net.imshit.aircraftwar.logic.EnemyListener
import net.imshit.aircraftwar.logic.GameEvents
import net.imshit.aircraftwar.logic.Games
import net.imshit.aircraftwar.util.listener.EnemyListener
import net.imshit.aircraftwar.util.listener.GameEvents

class EnemyBullet(
game: Games, initialX: Float, initialY: Float, speedX: Float, speedY: Float, power: Int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout.LayoutParams
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
import net.imshit.aircraftwar.Difficulty
import net.imshit.aircraftwar.databinding.ActivityGameBinding
import net.imshit.aircraftwar.logic.Difficulty
import net.imshit.aircraftwar.logic.Games

class GameActivity : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package net.imshit.aircraftwar.gui
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import net.imshit.aircraftwar.Difficulty
import net.imshit.aircraftwar.R
import net.imshit.aircraftwar.databinding.ActivityMainBinding
import net.imshit.aircraftwar.logic.Difficulty

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import net.imshit.aircraftwar.Difficulty
import net.imshit.aircraftwar.databinding.ActivityScoreboardBinding
import net.imshit.aircraftwar.logic.Difficulty

class ScoreboardActivity : AppCompatActivity() {
companion object {
Expand Down
13 changes: 11 additions & 2 deletions app/src/main/java/net/imshit/aircraftwar/logic/Games.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import android.util.Log
import android.view.SurfaceHolder
import android.view.SurfaceView
import android.view.ViewTreeObserver
import net.imshit.aircraftwar.Difficulty
import net.imshit.aircraftwar.util.ImageManager
import net.imshit.aircraftwar.element.aircraft.hero.HeroAircraft

sealed class Games(context: Context, attrs: AttributeSet?, soundMode: Boolean) :
SurfaceView(context, attrs), SurfaceHolder.Callback, Runnable {
Expand Down Expand Up @@ -36,6 +35,8 @@ sealed class Games(context: Context, attrs: AttributeSet?, soundMode: Boolean) :
var screenHeight = 0
private set

lateinit var heroAircraft: HeroAircraft

init {
viewTreeObserver.addOnGlobalLayoutListener(object :
ViewTreeObserver.OnGlobalLayoutListener {
Expand Down Expand Up @@ -66,4 +67,12 @@ sealed class Games(context: Context, attrs: AttributeSet?, soundMode: Boolean) :
override fun run() {
Log.e("FFFFF", "RUN")
}

fun notify(e: GameEvents) {
when (e) {
GameEvents.BOMB_ACTIVATE -> {
TODO()
}
}
}
}

0 comments on commit e6a4d10

Please sign in to comment.