Refactor marker management to use child count for occupancy checks; update road management to handle Marker2D types
This commit is contained in:
@@ -5,23 +5,4 @@ namespace ParasiticGod.Scripts;
|
||||
[GlobalClass]
|
||||
public partial class FollowerMarker : Marker2D
|
||||
{
|
||||
public bool IsOccupied { get; private set; }
|
||||
public Follower FollowerInstance { get; private set; }
|
||||
|
||||
public void PlaceFollower(Follower followerInstance)
|
||||
{
|
||||
if (IsOccupied) return;
|
||||
AddChild(followerInstance);
|
||||
followerInstance.Position = Vector2.Zero;
|
||||
IsOccupied = true;
|
||||
FollowerInstance = followerInstance;
|
||||
}
|
||||
|
||||
public void RemoveFollower()
|
||||
{
|
||||
if (!IsOccupied) return;
|
||||
FollowerInstance.QueueFree();
|
||||
FollowerInstance = null;
|
||||
IsOccupied = false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user