public static void fireTriggers(final HashSet<TriggerAttachment> triggersToBeFired,final HashMap<ICondition,Boolean> testedConditionsSoFar,final IDelegateBridge aBridge,final String beforeOrAfter,final String stepName,final boolean useUses,final boolean testUses,final boolean testChance,final boolean testWhen){
  final HashSet<TriggerAttachment> triggersToFire=new HashSet<>();
  for (  final TriggerAttachment t : triggersToBeFired) {
    if (testChance && !t.testChance(aBridge)) {
      continue;
    }
    triggersToFire.add(t);
  }
  triggerNotifications(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerPlayerPropertyChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerRelationshipTypePropertyChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerTerritoryPropertyChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerTerritoryEffectPropertyChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerUnitPropertyChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerRelationshipChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerAvailableTechChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerTechChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerProductionChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerProductionFrontierEditChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerSupportChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerChangeOwnership(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerUnitRemoval(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerPurchase(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerUnitPlacement(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerResourceChange(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerActivateTriggerOther(testedConditionsSoFar,triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  triggerVictory(triggersToFire,aBridge,beforeOrAfter,stepName,useUses,testUses,false,testWhen);
  if (useUses) {
    setUsesForWhenTriggers(triggersToFire,aBridge,useUses);
  }
}

public static void fireTriggers ( final HashSet < TriggerAttachment > triggersToBeFired , final HashMap < ICondition , Boolean > testedConditionsSoFar , final IDelegateBridge aBridge , final String beforeOrAfter , final String stepName , final boolean useUses , final boolean testUses , final boolean testChance , final boolean testWhen ) { final HashSet < TriggerAttachment > triggersToFire = new HashSet < > ( ) ; for ( final TriggerAttachment t : triggersToBeFired ) { if ( testChance && ! t . testChance ( aBridge ) ) { continue ; } triggersToFire . add ( t ) ; } triggerNotifications ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerPlayerPropertyChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerRelationshipTypePropertyChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerTerritoryPropertyChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerTerritoryEffectPropertyChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerUnitPropertyChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerRelationshipChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerAvailableTechChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerTechChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerProductionChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerProductionFrontierEditChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerSupportChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerChangeOwnership ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerUnitRemoval ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerPurchase ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerUnitPlacement ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerResourceChange ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerActivateTriggerOther ( testedConditionsSoFar , triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; triggerVictory ( triggersToFire , aBridge , beforeOrAfter , stepName , useUses , testUses , false , testWhen ) ; if ( useUses ) { setUsesForWhenTriggers ( triggersToFire , aBridge , useUses ) ; } }
this will fire all triggers , and it will not test to see if they are satisfied or not first . please use collectandfiretriggers instead of using this directly . to see if they are satisfied , first create the list of triggers using matches + triggerattachment . gettriggers . then test the triggers using rulesattachment . getallconditionsrecursive , and rulesattachment . testallconditions
