-
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.
added BuffTypes so now we have passive and continuous buffs
added buffHandlers multiple cellAffects for one cell handled all cellAffects !
- Loading branch information
Saee Saadat
authored and
Siniorss
committed
May 7, 2019
1 parent
e81e046
commit a5f1931
Showing
13 changed files
with
175 additions
and
32 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
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
26 changes: 26 additions & 0 deletions
26
duelyst/src/Model/card/spell/BuffTypes/BuffTypeContinuous.java
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,26 @@ | ||
package Model.card.spell.BuffTypes; | ||
|
||
import Model.card.spell.Buff.Buff; | ||
import exeption.BuffHasntBeenDeployedYetException; | ||
import exeption.InvalidCellException; | ||
|
||
public class BuffTypeContinuous extends BuffTypes{ | ||
public BuffTypeContinuous() { | ||
shouldBeDispelled = false ; | ||
} | ||
|
||
@Override | ||
public void handleBeginningOfTheTurn() throws InvalidCellException, BuffHasntBeenDeployedYetException { | ||
if (buff.getDuration()==0) { | ||
buff.destroy(); | ||
return ; | ||
} | ||
buff.reduceDuration(); | ||
buff.affect(); | ||
} | ||
|
||
@Override | ||
public void handleEndOfTheTurn() throws InvalidCellException{ | ||
buff.destroy(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
duelyst/src/Model/card/spell/BuffTypes/BuffTypePassive.java
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,22 @@ | ||
package Model.card.spell.BuffTypes; | ||
|
||
import Model.card.spell.Buff.Buff; | ||
import exeption.BuffHasntBeenDeployedYetException; | ||
import exeption.InvalidCellException; | ||
|
||
public class BuffTypePassive extends BuffTypes{ | ||
private static BuffTypePassive obj ; | ||
|
||
public BuffTypePassive() { | ||
shouldBeDispelled = false ; | ||
} | ||
|
||
@Override | ||
public void handleBeginningOfTheTurn() throws InvalidCellException, BuffHasntBeenDeployedYetException { | ||
} | ||
|
||
@Override | ||
public void handleEndOfTheTurn() throws InvalidCellException{ | ||
buff.destroy(); | ||
} | ||
} |
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,33 @@ | ||
package Model.card.spell.BuffTypes; | ||
|
||
import Model.card.spell.Buff.Buff; | ||
import exeption.BuffHasntBeenDeployedYetException; | ||
import exeption.InvalidCellException; | ||
|
||
import java.util.ArrayList; | ||
|
||
public abstract class BuffTypes { | ||
protected Buff buff ; | ||
protected static ArrayList<Buff> buffs = new ArrayList<>() ; | ||
protected boolean shouldBeDispelled = true ; | ||
|
||
public void setBuff(Buff buff) { | ||
this.buff = buff; | ||
} | ||
|
||
public static ArrayList<Buff> getBuffs() { | ||
return buffs; | ||
} | ||
|
||
public boolean isShouldBeDispelled() { | ||
return shouldBeDispelled; | ||
} | ||
|
||
public static void addToBuffs(Buff buff){ | ||
buffs.add(buff) ; | ||
} | ||
public abstract void handleBeginningOfTheTurn() throws InvalidCellException , BuffHasntBeenDeployedYetException; | ||
|
||
public abstract void handleEndOfTheTurn() throws InvalidCellException; | ||
} | ||
|
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
11 changes: 11 additions & 0 deletions
11
duelyst/src/exeption/BuffHasntBeenDeployedYetException.java
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,11 @@ | ||
package exeption; | ||
|
||
public class BuffHasntBeenDeployedYetException extends Exception { | ||
|
||
public BuffHasntBeenDeployedYetException(String message) { | ||
super(message); | ||
} | ||
|
||
public BuffHasntBeenDeployedYetException() { | ||
} | ||
} |