Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

stub out some classes

  • Loading branch information...
commit 1a9fab5e4fc868f202cc707a9fefacb5996b05ef 1 parent 297dd5d
@moritz authored
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
3  lib/HiH/Board.pm
@@ -0,0 +1,3 @@
+class HiH::Board {
+ has @.fields;
+}
View
4 lib/HiH/Field.pm
@@ -0,0 +1,4 @@
+class HiH::Field {
+ has Bool $.is-tarpit;
+ has @.hedgehogs;
+}
View
14 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;
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.