From ac7c3b57f2bc3462ad833d060971af027ebe0bba Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 10:17:19 +0800 Subject: [PATCH 01/15] Update Characters.java A better way of writing the code to reduce code redundancy --- src/characters/Characters.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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(); } From 52099fb57d44246718768b3a1eb41a0e98097752 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 10:19:03 +0800 Subject: [PATCH 02/15] Update Heroes.java Delete unnecessary code redundancy in this class. --- src/characters/Heroes.java | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/src/characters/Heroes.java b/src/characters/Heroes.java index d5f19c6..d6c4966 100644 --- a/src/characters/Heroes.java +++ b/src/characters/Heroes.java @@ -3,28 +3,9 @@ /** * Created by navenprasad25 on 03/04/2015. */ + //Edited by Yk on 7/4/15 public abstract class Heroes extends Characters{ - protected int life; - 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(); - } From 9de6743086e5edc9c37de7d46281aa96e948fd63 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 10:20:10 +0800 Subject: [PATCH 03/15] Update Villains.java Delete unnecessary code redundancy in this file. --- src/characters/Villains.java | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/characters/Villains.java b/src/characters/Villains.java index d7eec85..f041265 100644 --- a/src/characters/Villains.java +++ b/src/characters/Villains.java @@ -4,28 +4,7 @@ * Created by navenprasad25 on 03/04/2015. */ public abstract class Villains extends Characters { - - protected int life; - 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(); - } From 886ce45ea8c588e2dfb14ff792b3c1b876c3bc46 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 10:20:44 +0800 Subject: [PATCH 04/15] Update Villains.java --- src/characters/Villains.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/characters/Villains.java b/src/characters/Villains.java index f041265..8f7a824 100644 --- a/src/characters/Villains.java +++ b/src/characters/Villains.java @@ -3,6 +3,7 @@ /** * Created by navenprasad25 on 03/04/2015. */ + //Edited by Yk on 7/4/15 public abstract class Villains extends Characters { Villains(String theName){ super(theName); From 7830b7ff68ab05a2a5fb2deafbdfd1e9591ae998 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 10:31:18 +0800 Subject: [PATCH 05/15] Update Heroes.java --- src/characters/Heroes.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/characters/Heroes.java b/src/characters/Heroes.java index d6c4966..9e581a2 100644 --- a/src/characters/Heroes.java +++ b/src/characters/Heroes.java @@ -4,7 +4,7 @@ * Created by navenprasad25 on 03/04/2015. */ //Edited by Yk on 7/4/15 -public abstract class Heroes extends Characters{ +public class Heroes extends Characters{ Heroes(String name){ super(name); } From bfff9d9ad1ec301c7bcb7fd9274bde0d9d766857 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 10:31:57 +0800 Subject: [PATCH 06/15] Update Villains.java --- src/characters/Villains.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/characters/Villains.java b/src/characters/Villains.java index 8f7a824..ac48381 100644 --- a/src/characters/Villains.java +++ b/src/characters/Villains.java @@ -4,7 +4,7 @@ * Created by navenprasad25 on 03/04/2015. */ //Edited by Yk on 7/4/15 -public abstract class Villains extends Characters { +public class Villains extends Characters { Villains(String theName){ super(theName); } From 9eabf14b6a6bcde420218541fed892ccb7744f7f Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:01:00 +0800 Subject: [PATCH 07/15] Delete Characters.class --- .../DCUniverse/characters/Characters.class | Bin 681 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 out/production/DCUniverse/characters/Characters.class diff --git a/out/production/DCUniverse/characters/Characters.class b/out/production/DCUniverse/characters/Characters.class deleted file mode 100644 index d005bb8a4a1596576c4633b7df7f3249b55fb379..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 681 zcmZvZOHaZ;6ot?9VFimk6yJ}ygPO>~rH{mzxFWdFxNtYr21ZLsO5s+Vs0JmVOe%gT{Fl@@^;T2CcNT!h;IKEGJ;r^mR@rNXGf)T79}A3e@0i zTs{FdkiY5=V?Vf1x~5|0H#pFZyU1h7#T*}m#G3MdT$Wk{woa6dWHF%q6N+sf*P=hL!)4r0Lx?}moRA3p^iB*HEwz9n!7*7lg)&aJr Z539dmJA+rSIs-Nz|H11s;k8t?{tZ!XZhQa$ From 1b9e15fcfcea5ef81714bb16692c9b8408e874ba Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:01:08 +0800 Subject: [PATCH 08/15] Delete Heroes.class --- out/production/DCUniverse/characters/Heroes.class | Bin 710 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 out/production/DCUniverse/characters/Heroes.class diff --git a/out/production/DCUniverse/characters/Heroes.class b/out/production/DCUniverse/characters/Heroes.class deleted file mode 100644 index 0c2c749f75bbd6bac9a0f42d3dcce025993e21cd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 710 zcmZXR%}(1u6ot?D7i;!PJIS&VK%<#JRK0i*tMP}4v2`|W?F|-?2ugW>0dkgCaMK#J}8Ei9{sEXYN!#{zSO><1O z(X~wTcg%I|JJ^hE1F|bmi+qFAe6~ew{0D3`z?DiX%#>BUYRG-InH9sXL2nH2VEw=6 d8uxu&@#;Op$2~)=ah`AlzqbhySm$YB<1ZxrZ~OoN From 854eb3664f5e32009e77100a1ed711b412268fde Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:01:14 +0800 Subject: [PATCH 09/15] Delete Villains.class --- .../DCUniverse/characters/Villains.class | Bin 719 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 out/production/DCUniverse/characters/Villains.class diff --git a/out/production/DCUniverse/characters/Villains.class b/out/production/DCUniverse/characters/Villains.class deleted file mode 100644 index 8500e9bcb6d7b2f19c7b3da68c8db9d507bb0695..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 719 zcmZut&2G~`7@YNQYdb9|q|g>9g-aSFa^P502?ZflGQ9-l(A(D8+DjYkK z3W);`z(XNs9aB|+R$71G=b8Ct_UEtfKLEVMvj{#OuEWD4dp!=ZAL5CCSLzETAWj5= zSGv;XSfJNWKgcUNEM=7s$EMa*esnk?cC?rhyP4`ronFq*RsCL`mz->+i%gaiS!>(3 zL(dd?NwG95WGyqJ>g8~v%TnrUc_a{;LY>Na!~SO*f9J}ijWxG_NOMtEsBHGS)K_G1 zbSBUl8=1}C$&c;A$jF&`Bj++F#Ot3}%fYnm{R^EJhC1WLWu2+F+WPMN@$mwE%_7H2JSUn)~*$D8&4bjf|QV?1if2=-Bz&IV1?bXjr* Date: Tue, 7 Apr 2015 23:07:53 +0800 Subject: [PATCH 10/15] Create Characters.java --- .../DCUniverse/characters/Characters.java | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 out/production/DCUniverse/characters/Characters.java diff --git a/out/production/DCUniverse/characters/Characters.java b/out/production/DCUniverse/characters/Characters.java new file mode 100644 index 0000000..09085fb --- /dev/null +++ b/out/production/DCUniverse/characters/Characters.java @@ -0,0 +1,44 @@ +package characters; + +/** + * 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; + + Characters(String theName){ + name = theName; + alive = true; + } + + public void killCharacter(){ + name = null; + alive = false; + } + + public String getName(){ + return name; + } + + 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(); +} From 228e5a4844f6002ef3e8f260c8bcd8e038ee3727 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:08:51 +0800 Subject: [PATCH 11/15] Delete Characters.java --- .../DCUniverse/characters/Characters.java | 44 ------------------- 1 file changed, 44 deletions(-) delete mode 100644 out/production/DCUniverse/characters/Characters.java diff --git a/out/production/DCUniverse/characters/Characters.java b/out/production/DCUniverse/characters/Characters.java deleted file mode 100644 index 09085fb..0000000 --- a/out/production/DCUniverse/characters/Characters.java +++ /dev/null @@ -1,44 +0,0 @@ -package characters; - -/** - * 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; - - Characters(String theName){ - name = theName; - alive = true; - } - - public void killCharacter(){ - name = null; - alive = false; - } - - public String getName(){ - return name; - } - - 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(); -} From 3523f915536ad9fd87b8a2e5fb1b61a35a705a20 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:09:08 +0800 Subject: [PATCH 12/15] Create Characters.class --- .../DCUniverse/characters/Characters.class | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 out/production/DCUniverse/characters/Characters.class diff --git a/out/production/DCUniverse/characters/Characters.class b/out/production/DCUniverse/characters/Characters.class new file mode 100644 index 0000000..09085fb --- /dev/null +++ b/out/production/DCUniverse/characters/Characters.class @@ -0,0 +1,44 @@ +package characters; + +/** + * 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; + + Characters(String theName){ + name = theName; + alive = true; + } + + public void killCharacter(){ + name = null; + alive = false; + } + + public String getName(){ + return name; + } + + 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(); +} From b34a1d88e503344c097e6ae0db514d46d1180730 Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:09:30 +0800 Subject: [PATCH 13/15] Create Heroes.class --- out/production/DCUniverse/characters/Heroes.class | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 out/production/DCUniverse/characters/Heroes.class diff --git a/out/production/DCUniverse/characters/Heroes.class b/out/production/DCUniverse/characters/Heroes.class new file mode 100644 index 0000000..5e562f6 --- /dev/null +++ b/out/production/DCUniverse/characters/Heroes.class @@ -0,0 +1,13 @@ +package characters; + +/** + * Created by navenprasad25 on 03/04/2015. + */ +//Edited by Yk on 7/4/15 +public abstract class Heroes extends Characters{ + Heroes(String name){ + super(name); + } + + public abstract int fight(); +} From dd7fa24419a0cabbad710d33a4cc21c3c23e3d6f Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:09:54 +0800 Subject: [PATCH 14/15] Create Villains.class --- out/production/DCUniverse/characters/Villains.class | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 out/production/DCUniverse/characters/Villains.class diff --git a/out/production/DCUniverse/characters/Villains.class b/out/production/DCUniverse/characters/Villains.class new file mode 100644 index 0000000..50839a3 --- /dev/null +++ b/out/production/DCUniverse/characters/Villains.class @@ -0,0 +1,13 @@ +package characters; + +/** + * Created by navenprasad25 on 03/04/2015. + */ +//Edited by Yk on 7/4/15 +public abstract class Villains extends Characters { + Villains(String theName){ + super(theName); + } + + public abstract int fight(); +} From b361b9b8a8d5df684f0f908e711ef81a2e92a63b Mon Sep 17 00:00:00 2001 From: Yk Date: Tue, 7 Apr 2015 23:14:46 +0800 Subject: [PATCH 15/15] Update the abstract class problem This version has corrected the problem of abstract class inheritance existed in the last version. --- out/production/DCUniverse/characters/Characters.class | 1 - 1 file changed, 1 deletion(-) diff --git a/out/production/DCUniverse/characters/Characters.class b/out/production/DCUniverse/characters/Characters.class index 09085fb..3655af8 100644 --- a/out/production/DCUniverse/characters/Characters.class +++ b/out/production/DCUniverse/characters/Characters.class @@ -3,7 +3,6 @@ package characters; /** * Created by navenprasad25 on 03/04/2015. */ - //Edited by Yk on 7/4/15 public abstract class Characters { protected int life;