Fix unnecessary init value

This commit is contained in:
wjsjwr 2025-12-27 23:01:14 +08:00
parent bce6fffc3e
commit 1776244fac
4 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ public partial class Cube : StaticBody2D, ITileDraggable
new(new Vector2I(13, 33), equip2Rect), new(new Vector2I(13, 33), equip2Rect),
}; };
private bool _draggable = false; private bool _draggable;
public bool Draggable { public bool Draggable {
get => _draggable; get => _draggable;
set { set {

View File

@ -55,7 +55,7 @@ public partial class Lab : Node2D
GD.Print(H.RectHasPointInclusive(r, new Vector2I(1,0))); GD.Print(H.RectHasPointInclusive(r, new Vector2I(1,0)));
} }
private Label _moneyLabel = null; private Label _moneyLabel;
// Called every frame. 'delta' is the elapsed time since the previous frame. // Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta) public override void _Process(double delta)
{ {
@ -81,7 +81,7 @@ public partial class Lab : Node2D
} }
} }
private bool _isDragging = false; private bool _isDragging;
public void Pickup(ITileDraggable target) { public void Pickup(ITileDraggable target) {
if (target == null) return; if (target == null) return;
_isDragging = true; _isDragging = true;
@ -98,7 +98,7 @@ public partial class Lab : Node2D
DraggingTarget = null; DraggingTarget = null;
UpdateMap(); UpdateMap();
} }
public ITileDraggable DraggingTarget { get; set; } = null; public ITileDraggable DraggingTarget { get; set; }
public const int MapWidth = 40; public const int MapWidth = 40;
public const int MapHeight = 21; public const int MapHeight = 21;

View File

@ -5,7 +5,7 @@ using System.Collections.Generic;
public partial class Loader : Control public partial class Loader : Control
{ {
private ProgressBar _progressBar; private ProgressBar _progressBar;
private int _sceneLoaded = 0; private int _sceneLoaded;
private List<string> _resToLoad = new (){ private List<string> _resToLoad = new (){
"res://scenes/lab.tscn", "res://scenes/lab.tscn",
"res://scenes/player.tscn" "res://scenes/player.tscn"

View File

@ -9,7 +9,7 @@ public partial class Student : CharacterBody2D
{ {
public float Speed { get; set; } = 8.0f; public float Speed { get; set; } = 8.0f;
public const float JumpVelocity = -400.0f; public const float JumpVelocity = -400.0f;
[Export] public bool Use16X16Sprites { get; set; } = false; [Export] public bool Use16X16Sprites { get; set; }
// --- MVP: Model Binding --- // --- MVP: Model Binding ---
public StudentModel Model { get; private set; } public StudentModel Model { get; private set; }
@ -34,7 +34,7 @@ public partial class Student : CharacterBody2D
private Vector2I _targetSpecialPosition; private Vector2I _targetSpecialPosition;
private Vector2I _lastWalkablePosition; private Vector2I _lastWalkablePosition;
private double _duration = 0; private double _duration;
private void SitDown(double delta) { private void SitDown(double delta) {