コード例 #1
0
    public void ReceiveMessageFromQueueDiscreetly(GameObject sender)
    {
        MarkerFunctionality       mrkrf = GetComponent <MarkerFunctionality>();
        MessageQueueFunctionality mqf   = messageQueueBox.GetComponent <MessageQueueFunctionality>();

        GameObject consumedMessage = messageQueueBox.GetComponent <MessageQueueFunctionality>().DequeueFromMsgQueue(); //Consume message from queue

        //check queue status and do marking logic
        if (mrkrf.status == 1)//Message marked
        {
            mrkrf.Escalate();
        }
        else if (mrkrf.status == -1) //Nothing marked thus far
        {
            if (mqf.messageQueue.Count > 0)
            {
                if (mqf.messageQueue.Peek().GetComponent <MessageFunctionality>().representationHolding.index != -1)
                {
                    //marked
                    mrkrf.MessageMark(mqf.messageQueue.Peek().GetComponent <MessageFunctionality>().representationHolding);
                }
            }
        }

        Debug.Log("Message " + consumedMessage.ToString() + " accepted by " + this.gameObject.ToString());
        Destroy(consumedMessage);
    }
コード例 #2
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);
    }
コード例 #3
0
    public static void Outline(MessageDropped currEvent)
    {
        Color col = Color.magenta;
        MarkerFunctionality mf = Actors.allActors[currEvent.receiverId].GetComponent <MarkerFunctionality>();

        if (mf.status == 2) //Actor is marked
        {
            col = mf.representationHolding.colourOfMarker;
        }
        Actors.allActors[currEvent.receiverId].GetComponent <ActorFunctionality>().MomentaryOutline(col, outlineTime);
        Actors.allActors[currEvent.senderId].GetComponent <ActorFunctionality>().MomentaryOutline(Color.white, outlineTime);
    }