Commit 1db39b22 authored by Ghyselen's avatar Ghyselen
Browse files

Factorising FollowerBehaviour Code

parent 009e8479
......@@ -11,9 +11,9 @@ import graphics.guiSkeleton.sprites.Sprite;
import graphics.guiSkeleton.sprites.SpriteStorage;
/**
*
*
* @author Lucas Delcros
* Classe pour diagla (le boss) juste du copy-paste d'autres entits
* Classe pour diagla (le boss) juste du copy-paste d'autres entites
*/
public class DiaglaEntityDisplayer extends EntityDisplayer{
......
......@@ -41,14 +41,13 @@ public class FollowerBehaviour {
ArrayList<String> target1 = new ArrayList<String>();
while (count1 > 0) {
String s = target.get(0);
target.remove(0);
switch (s) {
case "(":
target.remove(0);
count1 = count1 + 1;
target1.add(s);
break;
case ")":
target.remove(0);
count1 = count1 - 1;
if (count1 > 0) {
target1.add(s);
......@@ -56,7 +55,6 @@ public class FollowerBehaviour {
break;
default :
target1.add(s);
target.remove(0);
}
}
target1.add("EOF");
......@@ -68,14 +66,13 @@ public class FollowerBehaviour {
ArrayList<String> target2 = new ArrayList<String>();
while (count2 > 0) {
String s = target.get(0);
target.remove(0);
switch (s) {
case "(":
target.remove(0);
count2 = count2 + 1;
target2.add(s);
break;
case ")":
target.remove(0);
count2 = count2 - 1;
if (count2 > 0) {
target2.add(s);
......@@ -83,7 +80,6 @@ public class FollowerBehaviour {
break;
default :
target2.add(s);
target.remove(0);
}
}
target2.add("EOF");
......@@ -131,7 +127,7 @@ public class FollowerBehaviour {
case "guerrier" :
case "mage" :
case "rogue" :
/* TODO, je ne sais pas encore comment trouvé la classe d'un character */
/* TODO, je ne sais pas encore comment trouver la classe d'un character */
break;
}
return list;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment