mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
more tweaks from converting Player to a class.
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -5476,8 +5476,6 @@ src/forge/OldDeckIO.java svneol=native#text/plain
|
||||
src/forge/Phase.java svneol=native#text/plain
|
||||
src/forge/PhaseObserver.java svneol=native#text/plain
|
||||
src/forge/Player.java -text svneol=native#text/plain
|
||||
src/forge/PlayerLife.java svneol=native#text/plain
|
||||
src/forge/PlayerPoisonCounter.java -text svneol=native#text/plain
|
||||
src/forge/PlayerUtil.java -text svneol=native#text/plain
|
||||
src/forge/PlayerZone.java svneol=native#text/plain
|
||||
src/forge/PlayerZoneUtil.java svneol=native#text/plain
|
||||
|
||||
@@ -7691,7 +7691,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
boolean paid = AllZone.GameAction.payLife(card.getController(), 1, card);
|
||||
boolean paid = card.getController().payLife(1, card);
|
||||
|
||||
//this order is very important, do not change
|
||||
stop();
|
||||
@@ -7755,7 +7755,7 @@ public class CardFactory implements NewConstants {
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
boolean paid = AllZone.GameAction.payLife(card.getController(), 1, card);
|
||||
boolean paid = card.getController().payLife(1, card);
|
||||
|
||||
//this order is very important, do not change
|
||||
stop();
|
||||
|
||||
@@ -2573,21 +2573,6 @@ public class GameAction {
|
||||
return list.contains(card);
|
||||
}
|
||||
|
||||
public boolean payLife(Player player, int lifePayment, Card source){
|
||||
if( null == player ) return false;
|
||||
else return player.payLife(lifePayment, source);
|
||||
// if(player == null) return false;
|
||||
//
|
||||
// int curLife = player.getLife();
|
||||
//
|
||||
// if (lifePayment <= curLife){
|
||||
// player.subtractLife(lifePayment, source);
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
|
||||
}
|
||||
|
||||
//removes all damage from player's creatures
|
||||
public void removeDamage(Player player) {
|
||||
PlayerZone p = AllZone.getZone(Constant.Zone.Play, player);
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
/*package forge;
|
||||
public class PlayerLife extends MyObservable implements java.io.Serializable
|
||||
{
|
||||
private static final long serialVersionUID = -1614695903669967202L;
|
||||
|
||||
private String player;
|
||||
private Card playerCard;
|
||||
private int life;
|
||||
private int assignedDamage;//from combat
|
||||
|
||||
public void setPlayerCard(Card playerCard) { this.playerCard = playerCard; }
|
||||
public Card getPlayerCard() { return playerCard; }
|
||||
public void setAssignedDamage(int n) { assignedDamage = n; }
|
||||
public int getAssignedDamage() { return assignedDamage; }
|
||||
|
||||
public PlayerLife(String pl)
|
||||
{
|
||||
player = pl;
|
||||
if (player.isHuman())
|
||||
setPlayerCard(AllZone.CardFactory.HumanNullCard);
|
||||
else
|
||||
setPlayerCard(AllZone.CardFactory.ComputerNullCard);
|
||||
}
|
||||
|
||||
public int getLife()
|
||||
{
|
||||
return life;
|
||||
}
|
||||
public void setLife(int life2)
|
||||
{
|
||||
life = life2;
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
public void addLife(int life2)
|
||||
{
|
||||
life += life2;
|
||||
this.updateObservers();
|
||||
}
|
||||
public void subtractLife(int life2, Card SourceCard)
|
||||
{
|
||||
life -= life2;
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
public void payLife(int life2) // change this to subtractLife
|
||||
{
|
||||
subtractLife(life2, null);
|
||||
}
|
||||
} */
|
||||
@@ -1,26 +0,0 @@
|
||||
/*package forge;
|
||||
public class PlayerPoisonCounter extends MyObservable implements java.io.Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 7559655609258111697L;
|
||||
private int poisonCounters;
|
||||
|
||||
public int getPoisonCounters()
|
||||
{
|
||||
return poisonCounters;
|
||||
}
|
||||
public void setPoisonCounters(int poisonCounters2)
|
||||
{
|
||||
poisonCounters = poisonCounters2;
|
||||
this.updateObservers();
|
||||
}
|
||||
public void addPoisonCounters(int poisonCounters2)
|
||||
{
|
||||
poisonCounters += poisonCounters2;
|
||||
this.updateObservers();
|
||||
}
|
||||
public void subtractLife(int poisonCounters2)
|
||||
{
|
||||
poisonCounters -= poisonCounters2;
|
||||
this.updateObservers();
|
||||
}
|
||||
}*/
|
||||
Reference in New Issue
Block a user