From 4e433bbbdc2e445b1715f34cbacaa2c37e1a7d82 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Wed, 17 Aug 2011 15:58:47 +0200 Subject: [PATCH] cosmetics --- Java/com/cycojesus/Star.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Java/com/cycojesus/Star.java b/Java/com/cycojesus/Star.java index 63ec74e..f3e7a07 100644 --- a/Java/com/cycojesus/Star.java +++ b/Java/com/cycojesus/Star.java @@ -69,6 +69,7 @@ public class Star { } return giftsCounter; } + private int[] getPosition( char actor ) { int[] result = { 0, 0 }; int position = this.level.indexOf( actor ); @@ -76,18 +77,23 @@ public class Star { result[ 0 ] = position - ( result[ 1 ] * WIDTH ); return result; } + private char getCellAt( int x, int y ) { return this.level.charAt( ( y * WIDTH ) + x ); } + private void setCellAt( int x, int y, char value ) { this.level = this.level.substring( 0, ( y * WIDTH ) + x ) + value + this.level.substring( ( y * WIDTH ) + x + 1 ); } + public void switchActor( ) { this.moving = ( this.moving == BALL ) ? CUBE : BALL; } + private boolean areWeDoneYet( ) { return ( countGifts() == 0 ); } + public void move( direction where ) { // TODO int[] motion = { 0, 0 }; @@ -133,7 +139,6 @@ public class Star { that the move isn't noticeable. So it's commented. (maybe on a very slow machine it adds beauty?...) */ - /* display_level( s ); */ this.distanceTravelled++; /* increment distance_travelled */ }