Esempio n. 1
0
 @Override
 public EndTurnEvent handle(EndTurnEvent event) {
   for (EntityId entity : triggerQuery.list(data)) { // TODO: order results
     if (data.has(
         data.get(entity, EffectTriggerEntityComponent.class).entity, BoardCardComponent.class)) {
       enqueueEvent(new TriggerEffectEvent(entity));
     }
   }
   return event;
 }
 @Override
 public EffectEvent handle(EffectEvent event) {
   DealDamageEffectComponent damageComponent =
       data.get(event.effect, DealDamageEffectComponent.class);
   if (damageComponent != null && damageComponent.damage > 0) {
     for (EntityId target : event.targets) {
       //            for (EntityId target : data.get(event.effect,
       // EffectTargetsComponent.class).targets) {
       enqueueEvent(new DamageEvent(event.effect, target, damageComponent.damage));
     }
   }
   return event;
 }