Permalink
Browse files

Start extracting abstract engine

  • Loading branch information...
1 parent 5815436 commit fc0df5d977c135eb5df947eec4b699130ff720db @xaviershay committed Oct 14, 2010
Showing with 24 additions and 5 deletions.
  1. +19 −0 lib/dominion/engine.rb
  2. +3 −5 lib/dominion/ui.rb
  3. +2 −0 spec/game_spec.rb
View
@@ -0,0 +1,19 @@
+module Dominion
+ class Engine
+ attr_accessor :prompt, :input_buffer, :card_active
+
+ def setup
+ self.prompt = nil
+ self.input_buffer = ''
+ end
+
+ def draw(game, ctx = {})
+ end
+
+ def step(ctx)
+ end
+
+ def finalize
+ end
+ end
+end
View
@@ -1,14 +1,12 @@
require 'ffi-ncurses'
+require 'dominion/engine'
module Dominion; module UI; end; end;
-class Dominion::UI::NCurses
+class Dominion::UI::NCurses < Dominion::Engine
include FFI::NCurses
- attr_accessor :prompt, :input_buffer, :card_active
-
def setup
- self.prompt = nil
- self.input_buffer = ''
+ super
initscr
start_color
View
@@ -1,4 +1,6 @@
require 'spec_helper'
describe Dominion::Game do
+ describe '#run' do
+ end
end

0 comments on commit fc0df5d

Please sign in to comment.