1 $:.unshift(File.join(File.dirname(__FILE__), '..'))
4 require 'themes/loader'
6 require 'games/chess/main'
9 description = "KDE Board Game Suite"
11 about = KDE::AboutData.new("kaya", "Kaya", KDE.ki18n("Kaya"),
12 version, KDE.ki18n(description), KDE::AboutData::License_GPL, KDE.ki18n("(C) 2009 Paolo Capriotti"))
14 KDE::CmdLineArgs.init(ARGV, about)
16 app = KDE::Application.new
18 class Scene < Qt::GraphicsScene
24 theme_loader = ThemeLoader.new
25 theme = Struct.new(:pieces, :background).new
26 theme.pieces = theme_loader.get('Fantasy')
27 theme.background = theme_loader.get('Default', Point.new(8, 8))
29 chess = Game.get(:chess)
31 scene = Qt::GraphicsScene.new
33 state = chess.state.new
36 board = Board.new(scene, theme, chess, state)
37 board.observe :new_move do |data|
39 puts "execute #{move.src.x}, #{move.src.y}, #{move.dst.x}, #{move.dst.y}"
42 table = Table.new(scene, board)
43 table.size = Qt::Size.new(500, 500)
45 history = History.new(state)
46 controller = Controller.new(board, history)