示例#1
0
    public static void Outline(ActorDestroyed currEvent)
    {
        Color col = Color.magenta;
        MarkerFunctionality mf = Actors.allActors[currEvent.actorId].GetComponent <MarkerFunctionality>();

        if (mf.status == 2) //Actor is marked
        {
            col = mf.representationHolding.colourOfMarker;
        }
        Actors.allActors[currEvent.actorId].GetComponent <ActorFunctionality>().MomentaryOutline(col, outlineTime);
    }
示例#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);
        }
    }
示例#3
0
    public static void Handle(ActorDestroyed currEvent)
    {
        GameObject.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);
            Handle(newLog);
        }
    }
示例#4
0
    private static ActorEvent EventUnwrapper(string line)
    {
        ActorEvent ev = (JsonUtility.FromJson <ActorEvent>(line)); //Read into the event parent class

        //Now assign a specific class
        switch (ev.eventType) //Go through all possible event types
        {
        case "ACTOR_CREATED":
            ActorCreated specificActorCreatedEvent = (JsonUtility.FromJson <ActorCreated>(line));
            ev = specificActorCreatedEvent;
            break;

        case "MESSAGE_SENT":
            MessageSent specificMessageSentEvent = (JsonUtility.FromJson <MessageSent>(line));
            ev = specificMessageSentEvent;
            break;

        case "MESSAGE_RECEIVED":
            MessageReceived specificMessageReceivedEvent = (JsonUtility.FromJson <MessageReceived>(line));
            ev = specificMessageReceivedEvent;
            break;

        case "ACTOR_DESTROYED":
            ActorDestroyed specificActorDestroyedEvent = (JsonUtility.FromJson <ActorDestroyed>(line));
            ev = specificActorDestroyedEvent;
            break;

        case "LOG":
            Debug.Log("Log received");
            Log newLog = (JsonUtility.FromJson <Log>(line));
            ev = newLog;
            break;

        case "MESSAGE_DROPPED":
            MessageDropped specificMessageDroppedEvent = (JsonUtility.FromJson <MessageDropped>(line));
            ev = specificMessageDroppedEvent;
            break;

        default:
            //We don't know what this event is
            Debug.LogError("Unknown event encountered in JSON");
            break;
        }
        return(ev);
    }