feature/showcase_bugfixing_kathi_partII #16

Merged
Jonathan merged 33 commits from feature/showcase_bugfixing_kathi_partII into develop 2025-10-24 18:31:56 +02:00
2 changed files with 10 additions and 9 deletions
Showing only changes of commit d0ba4076b3 - Show all commits
@@ -39,7 +39,7 @@ public partial class FieldBehaviour2D : Sprite2D
case FieldState.Tilled:
FieldState = FieldState.Tilled;
_fieldSprite.Texture = Tilled;
PlantingInteraction.IsActive = false;
PlantingInteraction.IsActive = true;
break;
case FieldState.Watered:
FieldState = FieldState.Watered;
@@ -68,12 +68,9 @@ public partial class FieldBehaviour2D : Sprite2D
/// </summary>
public void Farm()
{
if (FieldState == FieldState.Watered)
if (TryPlant())
{
if (TryPlant())
{
UpdateFieldState(FieldState.Planted);
}
UpdateFieldState(FieldState.Planted);
}
}
@@ -100,7 +97,6 @@ public partial class FieldBehaviour2D : Sprite2D
if (plantBehaviour != null)
{
plantBehaviour.Field = this;
plantBehaviour.Grow();
}
success = true;
@@ -34,6 +34,13 @@ public partial class PlantBehaviour2D : Node2D
get => _field;
set => _field = value;
}
public override void _Ready()
{
_state = PlantState.Planted;
kziolkowski marked this conversation as resolved Outdated
Outdated
Review

CallGroup hat ziemlich viel codesmell. Kannst du gerne für jetzt so lassen, aber setz da am besten noch ein To-do hinter, damit wir daran denken, das zu ändern, sobald wir eine event bus implementierung haben.

CallGroup hat ziemlich viel codesmell. Kannst du gerne für jetzt so lassen, aber setz da am besten noch ein To-do hinter, damit wir daran denken, das zu ändern, sobald wir eine event bus implementierung haben.
_currentPlantSprite = GetRandomSprite(_seeds);
_currentPlantSprite.Visible = true;
}
/// <summary>
@@ -45,8 +52,6 @@ public partial class PlantBehaviour2D : Node2D
return;
GetTree().CallGroup("PlantGrowing", VesnaAnimations.MethodName.PlayFarmingAnimation);
// todo:
// find out why the last plant stage is being skipped the second time around
switch (_state)
{
case PlantState.None: