Merge games and plugins.
[kaya.git] / lib / plugins / games / shogi.rb
blob9f264c3480e6d6cf638b34c7c5510f04122f37fe
1 require 'games/shogi/state'
2 require 'games/shogi/pool'
3 require 'games/shogi/move'
4 require 'games/shogi/validator'
5 require 'games/shogi/policy'
6 require 'plugins/plugin'
8 module Shogi
10 class Game
11   include Plugin
12   
13   plugin :name => 'Shogi',
14          :id => :shogi,
15          :interface => :game,
16          :keywords => %w(shogi),
17          :depends => [:chess]
18   
19   attr_reader :size, :state, :board, :pool,
20               :policy, :move, :animator, :validator,
21               :piece, :players, :types, :actions
22               
23   def initialize
24     @size = Point.new(9, 9)
25     @state = Factory.new { State.new(board.new, pool, move, piece) }
26     @board = Factory.new { chess.board.component.new size }
27     @pool = Pool
28     @piece = chess.piece
29     @move = Move
30     @validator = Validator
31     @animator = chess.animator
32     @policy = Policy.new(move, validator)
33     
34     @players = [:white, :black]
35     @types = [:pawn, :lance, :horse, :silver, 
36               :gold, :bishop, :rook, :king]
37   end
38 end
40 end