Browse files

Merge pull request #6 from zoffixznet/fix-failures

Fix some failures
  • Loading branch information...
2 parents 2fbec98 + 7cc53cb commit 18cb5acec187d9170df3d4279a9a23f48d06c47a @masak committed Dec 10, 2015
View
2 lib/Druid/Game.pm
@@ -13,7 +13,7 @@ use Druid::Game::Subject;
#| The class does the role C<Druid::Game::Subject>, making it possible for
#| instances of other classes to subscribe to updates from instances of this
#| class, in an B<observer> pattern.
-class Druid::Game is Druid::Base does Druid::Game::Subject;
+unit class Druid::Game is Druid::Base does Druid::Game::Subject;
#| The size of a side of the (always quadratic) board.
has $.size;
View
8 lib/Druid/Game/Observer.pm
@@ -7,20 +7,20 @@
#|
#| Examples of classes which might want to observe a C<Druid::Game::Subject>
#| are classes derived from C<Druid::View> or C<Druid::Player>.
-role Druid::Game::Observer;
+unit role Druid::Game::Observer;
#| Gets called any time the C<Druid::Game::Subject> adds a piece to its game
#| board. Note that, for the purposes of this method, lintels are considered
#| to be three adjacent (but separate) pieces.
-method add-piece($height, $row, $column, $color) { ... };
+method add-piece($height, $row, $column, $color) { };
#| Gets called when the C<Druid::Game::Subject> swaps positions between the
#| two players.
-method swap() { ... }
+method swap() { }
#| Gets called when the C<Druid::Game::Subject> changes so fundamentally
#| that it's not feasible to track individual piece changes. This tells the
#| observer to recalculate everything from scratch.
-method reset() { ... }
+method reset() { }
# vim: filetype=perl6
View
2 lib/Druid/Game/Subject.pm
@@ -9,7 +9,7 @@ use Druid::Game::Observer;
#|
#| Examples of classes which might want to observe a C<Druid::Game::Subject>
#| are classes derived from C<Druid::View> or C<Druid::Player>.
-role Druid::Game::Subject;
+unit role Druid::Game::Subject;
has Druid::Game::Observer @.observers;
View
4 lib/Druid/Player.pm
@@ -6,7 +6,7 @@ use Druid::Game::Observer;
#| Represents a generic Druid player. A player belongs to a certain game, has
#| a piece color in that game, and is responsible for choosing legal moves
#| and making them.
-class Druid::Player is Druid::Base does Druid::Game::Observer;
+unit class Druid::Player is Druid::Base does Druid::Game::Observer;
#| The game this C<Druid::Player> is playing.
has Druid::Game $.game handles <size layers colors heights make-move>;
@@ -25,8 +25,6 @@ submethod BUILD(Druid::Game :$game!, Int :$color! where { $_ == 1|2 }) {
method choose-move() { ... }
-method add-piece(|) { ... }
-
method reset() { ... }
method swap() {
View
2 lib/Druid/Player/Computer.pm
@@ -5,7 +5,7 @@ use Druid::Player;
#| A computer player. It currently tries to move close to its opponent's
#| last move or, failing that, entirely randomly. Thus it is almost
#| ridiculously easily defeatable.
-class Druid::Player::Computer is Druid::Player;
+unit class Druid::Player::Computer is Druid::Player;
has $!last-move;
View
2 lib/Druid/Player/Human.pm
@@ -3,7 +3,7 @@ use Druid::Player;
#| A human player, i.e. a C<Druid::Player> whose moves are typed in on C<$*IN>
#| by a human.
-class Druid::Player::Human is Druid::Player;
+unit class Druid::Player::Human is Druid::Player;
method choose-move() {
do Whatever until my $move = self.input-valid-move();
View
3 lib/Druid/View.pm
@@ -4,11 +4,10 @@ use Druid::Game;
use Druid::Game::Observer;
#= Base class for classes that represent a C<Druid::Game> visually.
-class Druid::View is Druid::Base does Druid::Game::Observer;
+unit class Druid::View is Druid::Base does Druid::Game::Observer;
has Druid::Game $.game handles <size layers colors heights>;
-method add-piece() { ... }
method reset() { ... }
method swap() { ... }
View
2 lib/Druid/View/Text.pm
@@ -6,7 +6,7 @@ use Druid::View;
#| A textual view of a C<Druid::Game>. Draws a large isometric 3D view, with
#| the pieces rendered as ASCII blocks, and two smaller 2D views giving
#| information about the colors and heights of the pieces on the board.
-class Druid::View::Text is Druid::View;
+unit class Druid::View::Text is Druid::View;
has $!cached-board;

0 comments on commit 18cb5ac

Please sign in to comment.