Added job component and queue system

- Introduced a new JobComponent and JobQueue to manage jobs in the game.
- Created two new jobs: DigJob and InfectJob with their respective scripts.
- Updated CrystalGlowComponent, FreeCameraComponent, MushroomGlowComponent, WaterEffectComponent to improve logging messages.
- Adjusted camera movement limits in FreeCameraGameCameraComponent for better control.
- Added FiniteStateMachine class for managing states of entities.
- Implemented GlowingIdle state as an example of using the state machine.
- Included a utility function to fetch file paths by extension from a directory.
This commit is contained in:
Dan 2024-06-06 15:49:05 +01:00
parent fc896925d6
commit bb5724429a
23 changed files with 311 additions and 29 deletions

6
components/jobs/Dig.tscn Normal file
View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://bypebl5w1aivf"]
[ext_resource type="Script" path="res://components/jobs/scripts/dig.gd" id="1_my7sj"]
[node name="Dig" type="Node"]
script = ExtResource("1_my7sj")

View file

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://pbnva2nkgral"]
[ext_resource type="Script" path="res://components/jobs/scripts/infect.gd" id="1_xpq3i"]
[node name="Infect" type="Node"]
script = ExtResource("1_xpq3i")

View file

@ -0,0 +1,10 @@
extends Job
class_name DigJob
func _init() -> void:
job_name = "Dig"
job_description = "Dig some stuff!"
super._init()
func _ready() -> void:
Log.pr("Dig job added to the scene...")

View file

@ -0,0 +1,10 @@
extends Job
class_name InfectJob
func _init() -> void:
job_name = "Infect"
job_description = "Infect some roots"
super._init()
func _ready() -> void:
Log.pr("Infect job added to the scene...")

View file

@ -0,0 +1,11 @@
extends Node
class_name Job
signal job_completed
signal job_failed
var job_name : String
var job_description : String
func _init() -> void:
pass