From f6c547860020ab5e27bf48b9eb91fff37417ae9c Mon Sep 17 00:00:00 2001 From: js Date: Thu, 11 May 2023 11:15:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0valid=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../net/imshit/aircraftwar/element/AbstractFlyingObject.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/net/imshit/aircraftwar/element/AbstractFlyingObject.kt b/app/src/main/java/net/imshit/aircraftwar/element/AbstractFlyingObject.kt index 6f7e140..1803370 100644 --- a/app/src/main/java/net/imshit/aircraftwar/element/AbstractFlyingObject.kt +++ b/app/src/main/java/net/imshit/aircraftwar/element/AbstractFlyingObject.kt @@ -17,7 +17,10 @@ abstract class AbstractFlyingObject( val width: Float by lazy { this.image.width.toFloat() } val height: Float by lazy { this.image.height.toFloat() } protected open val boundingHeight: Float by lazy { this.height } - private var isValid: Boolean = true + var isValid: Boolean = true + private set + + fun notValid() = !this.isValid open fun forward(timeMs: Int) { this.x += this.speedX * timeMs