Class: SDC::AI::Script

Inherits:
Object
  • Object
show all
Defined in:
lib/core/AI.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Script

Returns a new instance of Script.



17
18
19
# File 'lib/core/AI.rb', line 17

def initialize(&block)
	@fiber = Fiber.new {block.call}
end

Instance Method Details

#running?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/core/AI.rb', line 25

def running?
	return @fiber.alive?
end

#tickObject



21
22
23
# File 'lib/core/AI.rb', line 21

def tick
	@fiber.resume
end