1 # Copyright (c) 2009 Paolo Capriotti <p.capriotti@gmail.com>
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 require 'plugins/plugin'
9 require_bundle 'crazyhouse', 'state'
10 require_bundle 'crazyhouse', 'validator'
11 require_bundle 'crazyhouse', 'serializer'
18 plugin :name => 'Crazyhouse',
21 :keywords => %w(chess),
22 :depends => [:chess, :shogi],
23 :bundle => 'crazyhouse'
25 attr_reader :size, :state, :board, :pool,
26 :policy, :move, :animator, :validator,
27 :piece, :players, :types, :serializer,
28 :notation, :game_writer, :game_extensions
31 @size = Point.new(8, 8)
32 @state = Factory.new(State) do
33 State.new(board.new, pool, move, piece)
39 @validator = Validator
40 @animator = chess.animator
41 @policy = chess.policy
43 @players = [:white, :black]
44 @types = [:pawn, :knight, :bishop, :rook, :queen, :king]
46 @serializer = Factory.new(Serializer) do |rep|
47 Serializer.new(rep, validator, move, piece, notation)
49 @notation = chess.notation
51 @game_writer = chess.game_writer