Skip to content

Commit

Permalink
stub out some classes
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Apr 8, 2012
1 parent 297dd5d commit 1a9fab5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/HiH/Board.pm
@@ -0,0 +1,3 @@
class HiH::Board {
has @.fields;
}
4 changes: 4 additions & 0 deletions lib/HiH/Field.pm
@@ -0,0 +1,4 @@
class HiH::Field {
has Bool $.is-tarpit;
has @.hedgehogs;
}
14 changes: 14 additions & 0 deletions lib/HiH/Move.pm
@@ -0,0 +1,14 @@
enum HiH::Direction is export (Left => -1, Forward => 0, Right => 1);

class HiH::Move {
has HiH::Direction $.direction = Forward;
has $.player;
has $.old-x;
has $.new-x;
method new-x() {
$.old-x + $.direction;
}
method new-y() {
$.old-x + $.direction == Forward ?? 1 !! 0;
}
}

0 comments on commit 1a9fab5

Please sign in to comment.