public void perform(Faction faction) { System.out.println("Doing " + name); if (random.nextBoolean()) // Spy was caught world.exposeSpy(faction); else { target.reduceTechLevel(); if (parent != null) parent.reportFinished(this); } }
@Override public boolean canPerform(Faction faction) { return world.hasSpy(faction) && !target.getTechLevel().isMinimum(); }
public DestroyTechTask(World world, Task parent) { super(true, "Destroy Tech Task", parent); this.target = world.getControllingFaction(); this.world = world; }
public SabotageTask(World world, Task parent) { super(false, "Sabotage Task", parent); this.world = world; this.target = world.getControllingFaction(); }