Рефактор.

This commit is contained in:
sasha80
2023-09-11 14:41:06 +03:00
parent a423a95ade
commit a09ab78fb1
6 changed files with 30 additions and 23 deletions

View File

@@ -45,13 +45,13 @@ signal threats_resized(th: Dictionary)
func _ready() -> void:
Log.info('Модуль обработки целей готов')
var threats = {} ## Список целей. Индекс - <номер цели>
var unit_key = REPSettings.get_unit_key('уарэп-капсрпб-отп')
var unit_key = repsettings.get_unit_key('уарэп-капсрпб-отп')
var unit = REPNetwork.units[unit_key]
var timer_check_lost: = Timer.new()
add_child(timer_check_lost)
unit.connect('data_received', Callable(self, 'on_data_capsrpb_received').bind(threats))
timer_check_lost.connect('timeout', Callable(self, 'on_timer_check_lost').bind(REPSettings.ThreatParams.time_lost, threats))
timer_check_lost.start(REPSettings.ThreatParams.time_lost / 1000.0)
timer_check_lost.connect('timeout', Callable(self, 'on_timer_check_lost').bind(repsettings.ThreatParams.time_lost, threats))
timer_check_lost.start(repsettings.ThreatParams.time_lost / 1000.0)
## Периодически удаляет устаревшие цели