예제 #1
0
    protected override void Awake()
    {
        base.Awake();
        //Convert the filtered entities list to a string with , between lines from the csv and send it to the vrlink dll
        List <string> filteredEntities = ReadFilteredEntities();
        string        filteredEntitiesListString;

        if (filteredEntities == null)
        {
            filteredEntitiesListString = "";
        }
        else
        {
            filteredEntitiesListString = String.Join(",", filteredEntities.ToArray());
        }
        ExerciseConnectionPtr = NetSimAgent.Instance.CreateExerciseConnection(port, exerciseId, siteId, applicationNumber, filteredEntitiesListString);

        fireCallback = new NetSimAgent.FireCallback(fireInteraction);
        NetSimAgent.Instance.SetFireCallback(ExerciseConnectionPtr, fireCallback);

        detonationCallback = new NetSimAgent.DetonationCallback(detonationInteraction);
        NetSimAgent.Instance.SetDetonationCallback(ExerciseConnectionPtr, detonationCallback);

        createEntityCallback = new NetSimAgent.CreateEntityCallback(createEntityInteraction);
        NetSimAgent.Instance.SetCreateEntityCallback(ExerciseConnectionPtr, createEntityCallback);

        acknowledgeCallback = new NetSimAgent.AcknowledgeCallback(acknowledgeInteraction);
        NetSimAgent.Instance.SetAcknowledgeCallback(ExerciseConnectionPtr, acknowledgeCallback);

        removeEntityCallback = new NetSimAgent.RemoveEntityCallback(removeEntityInteraction);
        NetSimAgent.Instance.SetRemoveEntityCallback(ExerciseConnectionPtr, removeEntityCallback);

        FireInteractionSubscribers       = new List <Action <FireInteraction> >();
        DetonationInteractionSubscribers = new List <Action <DetonationInteraction> >();

        CreateEntityInteractionSubscribers = new List <Action <CreateEntityInteraction> >();
        AcknowledgeInteractionSubscribers  = new List <Action <AcknowledgeInteraction> >();
        RemoveEntityInteractionSubscribers = new List <Action <RemoveEntityInteraction> >();
    }
예제 #2
0
 public void SetFireCallback(System.IntPtr exConnPtr, NetSimAgent.FireCallback fireCallback)
 {
     CppExerciseConnection.SetFireCallback(exConnPtr, fireCallback);
 }
예제 #3
0
 public extern static void SetFireCallback(IntPtr exConnPtr, NetSimAgent.FireCallback fireCallback);