Transmitter:
	Input signals are on lamps (accumulators)
	lamps are checked for power, if no power, nothing is output
	Output signals are done with two constant combinators
	Once per second, the input is checked, and outputs are updated
	Chests built nearby are all considered as a source of drones
	events: 
		on_build (transmitter any container)
			if transmitter 
				add dummy entities
				search chests
			if	chest
				search transmitters
				add chest to list of relevant chests
		on_tick (transmitter)
			see valid
			see power
			see signal "send order"
			if send order then 
				see all signals and construct order
				if no squad and drones requested then
					see needed drones
					see chests valid, chests inventory
					create squad
					play animation
				set order to squad 
				drain more power
				--disallow sending orders for next few ticks
			update squad 
			see changes in state 
			update output signas where needed
	data:
		squad
		own entities
		circuit interfaces
		nearby chests
		output from last update
		
Squad:
	Invisible indestructible uncolliding stone - destination
	invisible indestructible uncolliding drone - guide, several types with different speed
	Guide is set to follow destination
	drones are set to follow guide
	destination is teleported around
	Guide has slow long range zero damage attack to detect enemies
	if distraction is allowed, the attack causes temporary change of destination position
	create squad:
		spawn destination
		spawn guide
		--spawn projectiles from chests
		spawn drones
	set order
		update order
		update drone counts
	events:
		on_trigger_created_entity:
			perform distraction
		on_entity_die
			if all drones destroyed
				destroy the guide and the destination
				reset move order to default
		on_tick
			update times to live
			if distraction:
				update distraction timers
			if scout
				update seen
			update distance
			if cargo orders and small distance
				perform item transfers
				update item counts
			if landing and small distance
				perform landing
				check if drones remain
	data:
		guide,destination entities
		drone entities and their data:
			time to live
			cargo
		destination position
		distraction flag
		distraction timer
		special order at destination
		cached results:
			median time to live
			cargo
			seen
		
Landing pads:
	an item or a chest or a chest and power interface
	perform catching
	events:
		on_build
			create landing pad entities
			update global storages
		on_entity_die
			check if it is drone
			search nearby pads, that are valid, not full, powered
			decide which item to insert
			create projectile
		on_player_placed_equipment \ on_player_armor_inventory_changed \ on_player_removed_equipment
			check if it is portable landing pad
			store data
	data:
		global data:
			pads - stored in by force by surface by chunk manner
			portable pads by force
			last result - if last search was in the same chunk and the pad is still good use that
		pad
			stationary powered: entity 
			portable: equipment, grid (player)

Smart radars:
	accumulator for input circuit and power and constant combinator for output
	events:
		on_build:
			add entities
		on_tick:
			if cooldown passed
				see valid power signal
				make filter for entities
				scan area based on filter
				update output
	data:
		entities
		position
		surface
		cooldown (maybe not)

Map label:
	train stop with numeric name
	needs some mean to spawn it
	events:
		custom key event or console command:
			start a gui for placing the marker
			or
			place marker under the cursor
	data:
		entity, id, last_altered_by, known_as
	global:
		by_force
Tests:
	construction, robot construction
	chest addition\ removal
	rewiring
	squad creation, commanding, destruction, reinforcing
	all special orders, including mixed squads
	spawning of roboport, with blueprint, with incorrect blueprint
	squad distraction
	scout,carrier,cargo outputs
	incorrect special orders
	landing, landing in vicinity of multiple pads
	smart radar input, output, no power
	map label spawn
	map label use in the circuitry