package adk.sample.basic.event;

import adk.team.util.provider.DebrisRemovalSelectorProvider;
import adk.team.util.provider.WorldProvider;
import comlib.event.information.RoadMessageEvent;
import comlib.message.information.RoadMessage;
import rescuecore2.standard.entities.Blockade;
import rescuecore2.standard.entities.StandardWorldModel;

public class BasicRoadEvent implements RoadMessageEvent {

    private WorldProvider wp;
    private DebrisRemovalSelectorProvider drsp;

    public BasicRoadEvent(WorldProvider worldProvider, DebrisRemovalSelectorProvider debrisRemovalSelectorProvider) {
        this.wp = worldProvider;
        this.drsp = debrisRemovalSelectorProvider;
    }

    @Override
    public void receivedRadio(RoadMessage msg) {
        Blockade blockade = this.wp.reflectedMessage(msg);
        this.drsp.getDebrisRemovalSelector().add(blockade);
    }

    @Override
    public void receivedVoice(RoadMessage msg) {
        this.receivedRadio(msg);
    }
}

@@ -730,38 +730,185 @@
 io(RoadMessage m
-sg
+essage
 ) %7B%0A
+        if(message.getPassable()) %7B%0A            this.drsp.getDebrisRemovalSelector().remove(message.getRoadID());%0A        %7D%0A        else %7B%0A    
         Blockade
@@ -945,18 +945,22 @@
 essage(m
-sg
+essage
 );%0A     
@@ -954,32 +954,36 @@
 ssage);%0A        
+ 
+   
 this.drsp.getDeb
@@ -1014,24 +1014,34 @@
 (blockade);%0A
+        %7D%0A
     %7D%0A%0A    @
@@ -1092,18 +1092,22 @@
 essage m
-sg
+essage
 ) %7B%0A    
@@ -1134,10 +1134,14 @@
 io(m
-sg
+essage
 );%0A 

update BasicRoadEvent