mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
update ManaShards event
This commit is contained in:
@@ -552,6 +552,11 @@ public final class CMatchUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateShards(Iterable<PlayerView> shardsUpdate) {
|
||||||
|
//mobile adventure only..
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateCards(final Iterable<CardView> cards) {
|
public void updateCards(final Iterable<CardView> cards) {
|
||||||
for (final CardView c : cards) {
|
for (final CardView c : cards) {
|
||||||
|
|||||||
@@ -470,6 +470,13 @@ public class MatchController extends AbstractGuiGame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateShards(final Iterable<PlayerView> livesUpdate) {
|
||||||
|
for (final PlayerView p : livesUpdate) {
|
||||||
|
view.getPlayerPanel(p).updateShards();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateZones(final Iterable<PlayerZoneUpdate> zonesToUpdate) {
|
public void updateZones(final Iterable<PlayerZoneUpdate> zonesToUpdate) {
|
||||||
view.updateZones(zonesToUpdate);
|
view.updateZones(zonesToUpdate);
|
||||||
|
|||||||
@@ -260,6 +260,10 @@ public class VPlayerPanel extends FContainer {
|
|||||||
lblLife.update();
|
lblLife.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateShards() {
|
||||||
|
lblLife.updateShards();
|
||||||
|
}
|
||||||
|
|
||||||
public void updateManaPool() {
|
public void updateManaPool() {
|
||||||
tabManaPool.update();
|
tabManaPool.update();
|
||||||
}
|
}
|
||||||
@@ -506,6 +510,9 @@ public class VPlayerPanel extends FContainer {
|
|||||||
Gdx.input.vibrate(Math.min(vibrateDuration, 2000));
|
Gdx.input.vibrate(Math.min(vibrateDuration, 2000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private void updateShards() {
|
||||||
|
manaShards = player.getNumManaShards();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean tap(float x, float y, int count) {
|
public boolean tap(float x, float y, int count) {
|
||||||
|
|||||||
@@ -179,6 +179,11 @@ public class NetGuiGame extends AbstractGuiGame {
|
|||||||
send(ProtocolMethod.updateLives, livesUpdate);
|
send(ProtocolMethod.updateLives, livesUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateShards(Iterable<PlayerView> shardsUpdate) {
|
||||||
|
//mobile adventure local game only..
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPanelSelection(final CardView hostCard) {
|
public void setPanelSelection(final CardView hostCard) {
|
||||||
updateGameView();
|
updateGameView();
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
|
|||||||
private final Set<CardView> cardsUpdate = new HashSet<>();
|
private final Set<CardView> cardsUpdate = new HashSet<>();
|
||||||
private final Set<CardView> cardsRefreshDetails = new HashSet<>();
|
private final Set<CardView> cardsRefreshDetails = new HashSet<>();
|
||||||
private final Set<PlayerView> livesUpdate = new HashSet<>();
|
private final Set<PlayerView> livesUpdate = new HashSet<>();
|
||||||
|
private final Set<PlayerView> shardsUpdate = new HashSet<>();
|
||||||
private final Set<PlayerView> manaPoolUpdate = new HashSet<>();
|
private final Set<PlayerView> manaPoolUpdate = new HashSet<>();
|
||||||
private final PlayerZoneUpdates zonesUpdate = new PlayerZoneUpdates();
|
private final PlayerZoneUpdates zonesUpdate = new PlayerZoneUpdates();
|
||||||
private final Map<PlayerView, Object> playersWithValidTargets = Maps.newHashMap();
|
private final Map<PlayerView, Object> playersWithValidTargets = Maps.newHashMap();
|
||||||
@@ -69,6 +70,12 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
|
|||||||
livesUpdate.clear();
|
livesUpdate.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
synchronized (shardsUpdate) {
|
||||||
|
if (!shardsUpdate.isEmpty()) {
|
||||||
|
matchController.updateShards(shardsUpdate);
|
||||||
|
shardsUpdate.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
synchronized (manaPoolUpdate) {
|
synchronized (manaPoolUpdate) {
|
||||||
if (!manaPoolUpdate.isEmpty()) {
|
if (!manaPoolUpdate.isEmpty()) {
|
||||||
matchController.updateManaPool(manaPoolUpdate);
|
matchController.updateManaPool(manaPoolUpdate);
|
||||||
@@ -485,7 +492,7 @@ public class FControlGameEventHandler extends IGameEventVisitor.Base<Void> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Void visit(final GameEventPlayerShardsChanged event) {
|
public Void visit(final GameEventPlayerShardsChanged event) {
|
||||||
return processPlayer(event.player, livesUpdate);
|
return processPlayer(event.player, shardsUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ public interface IGuiGame {
|
|||||||
void updateManaPool(Iterable<PlayerView> manaPoolUpdate);
|
void updateManaPool(Iterable<PlayerView> manaPoolUpdate);
|
||||||
|
|
||||||
void updateLives(Iterable<PlayerView> livesUpdate);
|
void updateLives(Iterable<PlayerView> livesUpdate);
|
||||||
|
void updateShards(Iterable<PlayerView> shardsUpdate);
|
||||||
|
|
||||||
void setPanelSelection(CardView hostCard);
|
void setPanelSelection(CardView hostCard);
|
||||||
|
|
||||||
|
|||||||
@@ -5,34 +5,7 @@ import java.util.Collection;
|
|||||||
|
|
||||||
import forge.LobbyPlayer;
|
import forge.LobbyPlayer;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.event.EventValueChangeType;
|
import forge.game.event.*;
|
||||||
import forge.game.event.GameEvent;
|
|
||||||
import forge.game.event.GameEventBlockersDeclared;
|
|
||||||
import forge.game.event.GameEventCardAttachment;
|
|
||||||
import forge.game.event.GameEventCardChangeZone;
|
|
||||||
import forge.game.event.GameEventCardCounters;
|
|
||||||
import forge.game.event.GameEventCardDamaged;
|
|
||||||
import forge.game.event.GameEventCardDestroyed;
|
|
||||||
import forge.game.event.GameEventCardPhased;
|
|
||||||
import forge.game.event.GameEventCardRegenerated;
|
|
||||||
import forge.game.event.GameEventCardSacrificed;
|
|
||||||
import forge.game.event.GameEventCardStatsChanged;
|
|
||||||
import forge.game.event.GameEventCardTapped;
|
|
||||||
import forge.game.event.GameEventDayTimeChanged;
|
|
||||||
import forge.game.event.GameEventFlipCoin;
|
|
||||||
import forge.game.event.GameEventGameOutcome;
|
|
||||||
import forge.game.event.GameEventGameStarted;
|
|
||||||
import forge.game.event.GameEventLandPlayed;
|
|
||||||
import forge.game.event.GameEventManaBurn;
|
|
||||||
import forge.game.event.GameEventPlayerLivesChanged;
|
|
||||||
import forge.game.event.GameEventPlayerPoisoned;
|
|
||||||
import forge.game.event.GameEventRollDie;
|
|
||||||
import forge.game.event.GameEventShuffle;
|
|
||||||
import forge.game.event.GameEventSpellResolved;
|
|
||||||
import forge.game.event.GameEventTokenCreated;
|
|
||||||
import forge.game.event.GameEventTurnEnded;
|
|
||||||
import forge.game.event.GameEventZone;
|
|
||||||
import forge.game.event.IGameEventVisitor;
|
|
||||||
import forge.game.spellability.AbilityManaPart;
|
import forge.game.spellability.AbilityManaPart;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.zone.ZoneType;
|
import forge.game.zone.ZoneType;
|
||||||
@@ -99,6 +72,8 @@ public class EventVisualizer extends IGameEventVisitor.Base<SoundEffectType> imp
|
|||||||
@Override
|
@Override
|
||||||
public SoundEffectType visit(final GameEventPlayerLivesChanged event) { return event.newLives < event.oldLives ? SoundEffectType.LifeLoss : SoundEffectType.LifeGain; }
|
public SoundEffectType visit(final GameEventPlayerLivesChanged event) { return event.newLives < event.oldLives ? SoundEffectType.LifeLoss : SoundEffectType.LifeGain; }
|
||||||
@Override
|
@Override
|
||||||
|
public SoundEffectType visit(final GameEventPlayerShardsChanged event) { return SoundEffectType.TakeShard; }
|
||||||
|
@Override
|
||||||
public SoundEffectType visit(final GameEventManaBurn event) { return SoundEffectType.ManaBurn; }
|
public SoundEffectType visit(final GameEventManaBurn event) { return SoundEffectType.ManaBurn; }
|
||||||
@Override
|
@Override
|
||||||
public SoundEffectType visit(final GameEventPlayerPoisoned event) { return SoundEffectType.Poison; }
|
public SoundEffectType visit(final GameEventPlayerPoisoned event) { return SoundEffectType.Poison; }
|
||||||
|
|||||||
Reference in New Issue
Block a user