-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring minion creation and constants to use enums. Updated some
code to match Java naming/access modifier conventions.
- Loading branch information
Showing
8 changed files
with
158 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 | ||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.7 | ||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate | ||
org.eclipse.jdt.core.compiler.debug.localVariable=generate | ||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.source=1.8 | ||
org.eclipse.jdt.core.compiler.source=1.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
|
||
public enum MinionTypes { | ||
|
||
BASIC (255, 1, 1); | ||
|
||
private int health, attackDamage, movementSpeed; | ||
|
||
MinionTypes(int health, int attackDamage, int movementSpeed) { | ||
this.health = health; | ||
this.attackDamage = attackDamage; | ||
this.movementSpeed = movementSpeed; | ||
} | ||
|
||
public int getHealth() { | ||
return health; | ||
} | ||
|
||
public int getAttackDamage() { | ||
return attackDamage; | ||
} | ||
|
||
public int getMovementSpeed() { | ||
return movementSpeed; | ||
} | ||
|
||
/* | ||
public int getType() { | ||
return type; | ||
} | ||
*/ | ||
|
||
/* | ||
public int findDirection() { | ||
if (visits == map.getNum()) { | ||
// CALL TO MAKE NEXUS LOSE HEALTH | ||
return -1; | ||
} else { | ||
int xGoal = map.getNodes()[visits][0]; | ||
int yGoal = map.getNodes()[visits][1]; | ||
int[] Goals = map.getGui().hash(xGoal, yGoal); | ||
xGoal = Goals[0]; | ||
yGoal = Goals[1]; | ||
if (x == xGoal) { | ||
if (y == yGoal) { | ||
visits++; | ||
return findDirection(); | ||
} | ||
if (yGoal > y) { | ||
// MOVE DOWN | ||
return 2; | ||
} else { | ||
return 0; | ||
} | ||
} else { | ||
if (x > xGoal) { | ||
return 3; | ||
} else { | ||
return 1; | ||
} | ||
} | ||
} | ||
} | ||
public boolean go() { | ||
int direction = findDirection(); | ||
if (direction == -1) { | ||
alive = false; | ||
return map.getTF().getTowerArray()[0].takeDamage(); | ||
} | ||
if (direction == 0) { | ||
y-=movespeed; | ||
} | ||
if (direction == 1) { | ||
x+=movespeed; | ||
} | ||
if (direction == 2) { | ||
y+=movespeed; | ||
} | ||
if (direction == 3) { | ||
x-=movespeed; | ||
} | ||
return false; | ||
} | ||
public boolean isAlive() { | ||
return alive; | ||
} | ||
public int getHealth() { | ||
return health; | ||
} | ||
public void minionTakeDamage() { | ||
int dam = map.getTF().assignTotalDamage(x, y); | ||
health-=dam; | ||
if (health <= 0) { | ||
alive = false; | ||
} | ||
} | ||
*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters