Permalink
Browse files

stub out some classes

  • Loading branch information...
moritz committed Apr 8, 2012
1 parent 297dd5d commit 1a9fab5e4fc868f202cc707a9fefacb5996b05ef
Showing with 21 additions and 0 deletions.
  1. +3 −0 lib/HiH/Board.pm
  2. +4 −0 lib/HiH/Field.pm
  3. +14 −0 lib/HiH/Move.pm
View
@@ -0,0 +1,3 @@
+class HiH::Board {
+ has @.fields;
+}
View
@@ -0,0 +1,4 @@
+class HiH::Field {
+ has Bool $.is-tarpit;
+ has @.hedgehogs;
+}
View
@@ -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.