diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduReceiver.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduReceiver.java index 85a551a80a517c291f756cce38514d5620be0dfb..1497c16e81cf72ea9a9f990d8d6bbbf1cee95ec8 100755 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduReceiver.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduReceiver.java @@ -73,7 +73,22 @@ public class Yurk_EspduReceiver { System.out.println(receiptMessage); Vector3Double position = ((FirePdu)aPdu).getLocationInWorldCoordinates(); - System.out.println(" FirePdu locationInWorldCoordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); + //Yurkovich Updated: + EntityID firingEntity = ((FirePdu)aPdu).getFiringEntityID(); + Float range = ((FirePdu)aPdu).getRange(); + int missionIndedx = ((FirePdu)aPdu).getFireMissionIndex(); + Vector3Float pVelocity = new Vector3Float(); + pVelocity.setX(1.0f); + pVelocity.setY(2.0f); + pVelocity.setZ(0.0f); + + System.out.println(" FirePdu was shot by: " + firingEntity.toString()+ + " from locationInWorldCoordinates: [" + position.getX() + ", " + position.getY() + ", " + position.getZ() + "]"); + System.out.println("The munition has a range of: "+range+" and a velocity of: [" +pVelocity.getX()+ + ","+pVelocity.getY()+","+pVelocity.getZ()+"]."); + + + //End Yurkovich Update: } else diff --git a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java index a8c48acce82c22e19d19ab20c5bf4e6e90b634e7..0cc35c783fa9c57cfe7a1ec08c68d034ef742c2e 100644 --- a/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java +++ b/assignments/src/MV3500Cohort2019JulySeptember/homework4/Yurkovich/Yurk_EspduSender.java @@ -143,7 +143,7 @@ public class Yurk_EspduSender entityID.setSiteID ((short)1); // TODO utility method to allow int values entityID.setApplicationID((short)2); entityID.setEntityID ((short)3); - espdu.setEntityID(entityID); + espdu.setEntityID(entityID); // Set the entity type. SISO has a big list of enumerations, so that by // specifying various numbers we can say this is an M1A2 American tank, @@ -152,8 +152,8 @@ public class Yurk_EspduSender // enumerations in C++ and Java, but to keep things simple we just use // numbers here. - // New way using entity jar(s) - espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.M1A2()); + // New way using entity jar(s) + espdu.setEntityType(new edu.nps.moves.dis7.entities.usa.platform.land.M1A2()); // Manual way: /* @@ -256,7 +256,17 @@ public class Yurk_EspduSender byte[] espduArray = baos.toByteArray(); FirePdu firePdu = new FirePdu(); - firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation()); + firePdu.setLocationInWorldCoordinates(espdu.getEntityLocation()); + firePdu.setFiringEntityID(espdu.getEntityID()); + firePdu.setRange((float) 200.00); + firePdu.setFireMissionIndex(1); + Vector3Float pVelocity = new Vector3Float(); + pVelocity.setX(1.0f); + pVelocity.setY(2.0f); + pVelocity.setZ(0.0f); + firePdu.setVelocity(pVelocity); + + byte[] fireArray = firePdu.marshal(); broadcastAddresses = getBroadcastAddresses();