Sha256: 5b60dfdec3598bb92a42c12c801fb82366167590253cfdeaf28d759fee55cbcf

Contents?: true

Size: 889 Bytes

Versions: 1

Compression:

Stored size: 889 Bytes

Contents

require 'gamefic/engine/tty'

module Gamefic
  module Sdk
    class Shell
      class Test
        def initialize(directory:)
          @path = directory
          raise "Invalid path: #{@path}" unless File.exist?(@path)
        end

        def run
          puts "Loading..."
          config = Gamefic::Sdk::Config.new(@path)
          if config.auto_import?
            puts "Importing scripts..."
            Shell.start ['import', @path, '--quiet']
          end
          paths = [config.script_path, config.import_path, Gamefic::Sdk::GLOBAL_SCRIPT_PATH]
          plot = Gamefic::Sdk::Debug::Plot.new Source::File.new(*paths)
          plot.script 'main'
          # @todo Debug is temporarily disabled.
          #plot.script 'debug'
          engine = Engine::Tty.new plot
          engine.connect
          puts "\n"
          engine.run
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gamefic-sdk-1.7.0 lib/gamefic-sdk/shell/test.rb