package comlib.adk.launcher.dummy.event;

import comlib.adk.launcher.dummy.util.CivilianManager;
import comlib.event.information.CivilianMessageEvent;
import comlib.message.information.CivilianMessage;
import rescuecore2.standard.entities.Civilian;
import rescuecore2.standard.entities.StandardWorldModel;

public class AmbulanceCivilianEvent extends CivilianMessageEvent {

    private StandardWorldModel model;
    private CivilianManager civilianManager;

    public AmbulanceCivilianEvent(StandardWorldModel swm, CivilianManager sm) {
        this.model = swm;
        this.civilianManager = sm;
    }

    @Override
    public void receivedRadio(CivilianMessage msg) {
        if(msg.getBuriedness() > 0) {
            Civilian civilian = (Civilian)this.model.getEntity(msg.getHumanID());
            if (civilian == null) {
                model.addEntity(new Civilian(msg.getHumanID()));
                civilian = (Civilian) model.getEntity(msg.getHumanID());
            }
            civilian.isHPDefined();
            civilian.isBuriednessDefined();
            civilian.isDamageDefined();
            civilian.isPositionDefined();
            civilian.setHP(msg.getHP());
            civilian.setBuriedness(msg.getBuriedness());
            civilian.setDamage(msg.getDamage());
            civilian.setPosition(msg.getPosition());

            this.civilianManager.add(civilian);
        }
    }
}

@@ -39,63 +39,8 @@
 t;%0A%0A
-import comlib.adk.launcher.dummy.util.CivilianManager;%0A
 impo
@@ -351,24 +351,26 @@
  model;%0A    
+//
 private Civi
@@ -455,16 +455,18 @@
 odel swm
+/*
 , Civili
@@ -477,16 +477,18 @@
 nager sm
+*/
 ) %7B%0A    
@@ -509,32 +509,34 @@
  = swm;%0A        
+//
 this.civilianMan
@@ -1299,24 +1299,26 @@
             
+//
 this.civilia

update Ambulance