diff --git a/out/production/DCUniverse/characters/Characters.class b/out/production/DCUniverse/characters/Characters.class index d005bb8..3655af8 100644 Binary files a/out/production/DCUniverse/characters/Characters.class and b/out/production/DCUniverse/characters/Characters.class differ diff --git a/out/production/DCUniverse/characters/Heroes.class b/out/production/DCUniverse/characters/Heroes.class index 0c2c749..5e562f6 100644 Binary files a/out/production/DCUniverse/characters/Heroes.class and b/out/production/DCUniverse/characters/Heroes.class differ diff --git a/out/production/DCUniverse/characters/Villains.class b/out/production/DCUniverse/characters/Villains.class index 8500e9b..50839a3 100644 Binary files a/out/production/DCUniverse/characters/Villains.class and b/out/production/DCUniverse/characters/Villains.class differ diff --git a/src/characters/Characters.java b/src/characters/Characters.java index 78b0485..85bff58 100644 --- a/src/characters/Characters.java +++ b/src/characters/Characters.java @@ -3,7 +3,10 @@ /** * Created by navenprasad25 on 03/04/2015. */ + + //Edited by Yk on 7/4/15 public abstract class Characters { + protected int life; private String name; protected boolean alive; @@ -24,9 +27,20 @@ public String getName(){ public boolean isAlive(){ return alive; } + public int getLife(){ + return life; + } + public boolean checkAlive() { + if(life <= 0) + alive = false; + return alive; + } - + public void takeDamage(int damage){ + life = life - damage; + } + public abstract int fight(); } diff --git a/src/characters/Heroes.java b/src/characters/Heroes.java index d5f19c6..9e581a2 100644 --- a/src/characters/Heroes.java +++ b/src/characters/Heroes.java @@ -3,28 +3,9 @@ /** * Created by navenprasad25 on 03/04/2015. */ -public abstract class Heroes extends Characters{ - protected int life; - + //Edited by Yk on 7/4/15 +public class Heroes extends Characters{ Heroes(String name){ super(name); } - - public int getLife(){ - return life; - } - - public boolean checkAlive() { - if(life <= 0) - alive = false; - return alive; - } - - public void takeDamage(int damage){ - life = life - damage; - } - - - public abstract int fight(); - } diff --git a/src/characters/Villains.java b/src/characters/Villains.java index d7eec85..ac48381 100644 --- a/src/characters/Villains.java +++ b/src/characters/Villains.java @@ -3,29 +3,9 @@ /** * Created by navenprasad25 on 03/04/2015. */ -public abstract class Villains extends Characters { - - protected int life; - + //Edited by Yk on 7/4/15 +public class Villains extends Characters { Villains(String theName){ super(theName); } - - public int getLife(){ - return life; - } - - public boolean checkAlive() { - if(life <= 0) - alive = false; - return alive; - } - - public void takeDamage(int damage){ - life = life - damage; - } - - - public abstract int fight(); - }