Class: Gamefic::Sdk::Shell::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic-sdk/shell/test.rb

Instance Method Summary collapse

Constructor Details

#initialize(directory:) ⇒ Test

Returns a new instance of Test.



8
9
10
11
12
# File 'lib/gamefic-sdk/shell/test.rb', line 8

def initialize(directory:)
  @path = directory
  raise "Invalid path: #{@path}" unless File.exist?(@path)
  puts "Loading..."
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
# File 'lib/gamefic-sdk/shell/test.rb', line 14

def run
  paths = config_path.script_paths + [Gamefic::Sdk::GLOBAL_SCRIPT_PATH]
  plot = Gamefic::Sdk::Debug::Plot.new Source::File.new(*paths)
  plot.script 'main'
  plot.script 'debug'
  engine = Engine::Tty.new plot
  engine.connect
  puts "\n"
  engine.run
end