package comlib.message.information;

import comlib.message.MapMessage;
import comlib.message.MessageID;
import rescuecore2.standard.entities.Blockade;
import rescuecore2.worldmodel.EntityID;

public class RoadMessage extends MapMessage {

    private EntityID id;
    private EntityID position;
    private int repairCost;
    private int[] apexes;
    private int x;
    private int y;

    public RoadMessage(Blockade blockade) {
        super(MessageID.roadMessage);
        this.id = blockade.getID();
        this.position = blockade.getPosition();
        this.repairCost = blockade.getRepairCost();
        this.apexes = blockade.getApexes();
        this.x = blockade.getX();
        this.y = blockade.getY();

    }

    public RoadMessage() {
        super(MessageID.roadMessage);
    }

    public EntityID getId() {
        return this.id;
    }

    public EntityID getPosition() {
        return this.position;
    }

    public int getRepairCost() {
        return this.repairCost;
    }

    public int[] getApexes() {
        return this.apexes;
    }

    public int getX() {
        return this.x;
    }

    public int getY() {
        return this.y;
    }
}

@@ -248,19 +248,92 @@
 ate 
-EntityID id
+int rawBlockadeID;%0A    private int rawHumanPosition;%0A    private EntityID blockadeID
 ;%0A  
@@ -351,17 +351,22 @@
 ntityID 
-p
+humanP
 osition;
@@ -394,24 +394,26 @@
 irCost;%0A    
+//
 private int%5B
@@ -422,24 +422,26 @@
 apexes;%0A    
+//
 private int 
@@ -443,24 +443,26 @@
  int x;%0A    
+//
 private int 
@@ -560,18 +560,26 @@
    this.
-id
+blockadeID
  = block
@@ -600,25 +600,30 @@
        this.
-p
+humanP
 osition = bl
@@ -700,24 +700,26 @@
 ();%0A        
+//
 this.apexes 
@@ -746,24 +746,26 @@
 ();%0A        
+//
 this.x = blo
@@ -782,24 +782,26 @@
 ();%0A        
+//
 this.y = blo
@@ -849,86 +849,365 @@
 age(
-) %7B%0A        super(MessageID.roadMessage);%0A    %7D%0A%0A    public EntityID getId() %7B
+int time, int ttl, int id, int position, int cost) %7B%0A        super(MessageID.roadMessage, time, ttl);%0A        this.rawBlockadeID = id;%0A        this.rawHumanPosition = position;%0A        this.repairCost = cost;%0A    %7D%0A%0A    public EntityID getID() %7B%0A        if(this.blockadeID == null) %7B%0A            this.blockadeID = new EntityID(this.rawBlockadeID);%0A        %7D
 %0A   
@@ -1223,18 +1223,26 @@
 rn this.
-id
+blockadeID
 ;%0A    %7D%0A
@@ -1274,24 +1274,145 @@
 osition() %7B%0A
+        if(this.humanPosition == null) %7B%0A            this.humanPosition = new EntityID(this.rawHumanPosition);%0A        %7D%0A
         retu
@@ -1419,17 +1419,22 @@
 rn this.
-p
+humanP
 osition;
@@ -1505,32 +1505,39 @@
 airCost;%0A    %7D%0A%0A
+    /*%0A
     public int%5B%5D
@@ -1693,10 +1693,17 @@
 ;%0A    %7D%0A
+    */%0A
 %7D%0A

add RoadMessage ()