Esempio n. 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> >();
    }
Esempio n. 2
0
 public void SetCreateEntityCallback(System.IntPtr exConnPtr, NetSimAgent.CreateEntityCallback createEntityCallback)
 {
     CppExerciseConnection.SetCreateEntityCallback(exConnPtr, createEntityCallback);
 }
Esempio n. 3
0
 public extern static void SetCreateEntityCallback(IntPtr exConnPtr, NetSimAgent.CreateEntityCallback createEntityCallback);