Sha256: 9eb03db87bd8e037c55849384b146d60981265dc8479a990881cdbd34f87da16

Contents?: true

Size: 912 Bytes

Versions: 5

Compression:

Stored size: 912 Bytes

Contents

#!/usr/bin/env ruby
$: << "#{File.dirname(__FILE__)}/../config"

begin
  # optional file
  require "environment" 
rescue LoadError => err
end

class GameboxApp
  attr_reader :context, :game
  def self.run(argv,env)
    GameboxApp.new.start argv, env
  end

  def initialize
    @context = Conject.default_object_context
  end

  def setup
    @game = @context[:game]
    @game.configure
    @config_manager = @context[:config_manager]
    setup_debug_server if @config_manager[:debug_server] || ARGV.include?("-debug-server")
  end

  def setup_debug_server
    Thread.new do
      loop do
        binding.remote_pry
      end
    end
  end

  def main_loop
    @input_manager = @context[:input_manager]
    @input_manager.register @game
    @input_manager.show
  end

  def shutdown
  end

  def start(argv,env)
    setup

    main_loop

    shutdown
  end
end

if $0 == __FILE__
  GameboxApp.run ARGV, ENV
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gamebox-0.4.0.rc5 lib/gamebox/gamebox_application.rb
gamebox-0.4.0.rc4 lib/gamebox/gamebox_application.rb
gamebox-0.4.0.rc3 lib/gamebox/gamebox_application.rb
gamebox-0.4.0.rc2 lib/gamebox/gamebox_application.rb
gamebox-0.4.0.rc1 lib/gamebox/gamebox_application.rb