Exemple #1
0
    public void TagReached(TagReachedResponse trr)
    {
        Log newLog = new Log(1, "Breakpoint hit : " + transform.name); //Create a Log

        VisualizationHandler.Handle(newLog);                           //Send it to the Visualization Handler to be handled

        //Blink the visualRepresentation
        StartCoroutine(Blinker());
    }
Exemple #2
0
    public static void Handle(ActorDestroyed currEvent)
    {
        Destroy(Actors.allActors[currEvent.actorId]);
        Actors.allActors.Remove(currEvent.actorId);

        if (logCreateForEvent)
        {
            //Create a Log of it
            Log newLog = new Log(0, "Actor destroyed : " + currEvent.actorId);
            VisualizationHandler.Handle(newLog);
        }
    }
Exemple #3
0
    public static void Handle(MessageDropped currEvent)
    {
        //Do some animation to show disappearing message
        //Currently, this is visualized like MessageReceived
        ActorFunctionality af = Actors.allActors[currEvent.receiverId].GetComponent <ActorFunctionality>();

        af.ReceiveMessageFromQueueDiscreetly();

        if (logCreateForEvent)
        {
            //Create a Log of it
            Log newLog = new Log(0, "Message dropped : " + currEvent.receiverId);
            VisualizationHandler.Handle(newLog);
        }
    }
Exemple #4
0
    public static void Handle(MessageReceived currEvent)
    {
        GameObject recGO = Actors.allActors[currEvent.receiverId];
        //Use dictionary of actors to do this
        ActorFunctionality af = recGO.GetComponent <ActorFunctionality>();

        af.ReceiveMessageFromQueueDiscreetly(Actors.allActors[currEvent.senderId]);

        if (logCreateForEvent)
        {
            //Create a Log of it
            Log newLog = new Log(0, "Message received : " + currEvent.receiverId + ", message : " + currEvent.msg);
            VisualizationHandler.Handle(newLog);
        }
    }
Exemple #5
0
    public static void Handle(MessageSent currEvent)
    {
        GameObject senderGO = Actors.allActors[currEvent.senderId];
        //Use dictionary of actors to do this
        ActorFunctionality af = senderGO.GetComponent <ActorFunctionality>();

        af.GenerateMessageDiscreetly(Actors.allActors[currEvent.receiverId], currEvent.msg);

        if (logCreateForEvent)
        {
            //Create a Log of it
            Log newLog = new Log(0, "Message sent : " + currEvent.senderId + " to " + currEvent.receiverId + ", message : " + currEvent.msg);
            VisualizationHandler.Handle(newLog);
        }
    }
Exemple #6
0
    public static void Handle(ActorCreated currEvent)
    {
        GameObject go;

        if (currEvent.resourceId == "" || currEvent.resourceId == null)
        {
            go = Instantiate(VisualizationHandler.modelDictionary["Cube"]); //If type is not set, we want a cube
        }
        else
        {
            go = Instantiate(VisualizationHandler.modelDictionary[currEvent.resourceId]);
        }

        go.transform.name = currEvent.actorId;

        go.transform.parent = TraceImplement.rootOfActors.transform;//Add it to the root G.O.

        //Add this to the dictionary
        Actors.allActors.Add(currEvent.actorId, go);
        if (VisualizationHandler.sysActorNames.Any(go.transform.name.Contains))                            //System actors are different
        {
            go.transform.position = new Vector3(Random.Range(3.5f, 4.5f), 1f, Random.Range(-2.5f, -3.5f)); //A separate area->Marked in the inspector
        }
        else
        {
            go.transform.position = new Vector3(Random.Range(0f, 3.5f), Random.Range(1.25f, 1.9f), Random.Range(-1.5f, 1.5f));
            if (logCreateForEvent)
            {
                //Create a Log of it
                Log newLog = new Log(0, "Actor created : " + currEvent.actorId);
                VisualizationHandler.Handle(newLog);
            }
        }
        SuppressActorResponse sar     = new SuppressActorResponse(go.transform.name, true);
        SendMessageContext    context = new SendMessageContext(go, "SuppressOnOff", sar, SendMessageOptions.RequireReceiver);

        SendMessageHelper.RegisterSendMessage(context);
    }
Exemple #7
0
    private void MarkThis() //After status check
    {
        bool messagesExist = GetComponent <ActorFunctionality>().messageQueueBox.GetComponent <MessageQueueFunctionality>().messageQueue.Count > 0 ? true : false;

        if (messagesExist)
        {
            //We already know that status = -1

            representationHolding = Markers.AssignNewMarker(); //Get a representation
            if (representationHolding.index != -1)
            {
                status = 1;                         //Message is marked
                Color matColour = representationHolding.colourOfMarker;
                markerMat.color        = matColour; //Set the colour
                markerRenderer.enabled = true;      //Enable the renderer
            }
        }
        else
        {
            Log newLog = new Log(1, "Only Actors with messages can be marked"); //Create a Log
            VisualizationHandler.Handle(newLog);                                //Send it to the Visualization Handler to be handled
        }
    }
Exemple #8
0
 public override void HandleOutline()
 {
     VisualizationHandler.Outline(this);
 }
Exemple #9
0
 public override void HandleVisualization()
 {
     VisualizationHandler.Handle(this);
 }
Exemple #10
0
 public override void HandleDiscreetly()
 {
     VisualizationHandler.Handle(this);
 }
Exemple #11
0
 private static void TopographyUnwrapper(TopographyResponse tr)
 {
     VisualizationHandler.Handle(tr);
 }