Beispiel #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());
    }
Beispiel #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);
        }
    }
Beispiel #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);
        }
    }
Beispiel #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);
        }
    }
Beispiel #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);
        }
    }
Beispiel #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);
    }
Beispiel #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
        }
    }
Beispiel #8
0
 public override void HandleOutline()
 {
     VisualizationHandler.Outline(this);
 }
Beispiel #9
0
 public override void HandleVisualization()
 {
     VisualizationHandler.Handle(this);
 }
Beispiel #10
0
 public override void HandleDiscreetly()
 {
     VisualizationHandler.Handle(this);
 }
Beispiel #11
0
 private static void TopographyUnwrapper(TopographyResponse tr)
 {
     VisualizationHandler.Handle(tr);
 }