Пример #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Topic.Length != 0)
            {
                hash ^= Topic.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Client)
            {
                hash ^= Client.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Device)
            {
                hash ^= Device.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicSubscription)
            {
                hash ^= TopicSubscription.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Session)
            {
                hash ^= Session.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.SessionList)
            {
                hash ^= SessionList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Interaction)
            {
                hash ^= Interaction.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.InteractionList)
            {
                hash ^= InteractionList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMux)
            {
                hash ^= TopicMux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMuxList)
            {
                hash ^= TopicMuxList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemux)
            {
                hash ^= TopicDemux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemuxList)
            {
                hash ^= TopicDemuxList.GetHashCode();
            }
            hash ^= (int)typeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
    protected override TreeViewItem BuildRoot()

    {
        texIcon = AssetPreview.GetMiniTypeThumbnail(typeof(Flare));
        var iconType = typeof(T) == typeof(IInteraction) ? typeof(Animator) : typeof(CanvasRenderer);
        var root     = new TreeViewItem {
            id = InteractionList <T> .currentId, depth = -1, displayName = "Root"
        };
        var firstItem = new InteractionList <T>(root,
                                                SceneManager.GetActiveScene().GetRootGameObjects().Select(go => go.transform),
                                                InteractionList <T> .currentId, 0, typeof(T).ToString(), iconType);

        root.AddChild(firstItem);
        return(root);
    }
Пример #3
0
    public override void HandleInteractMsg(InteractMsg msg)
    {
        //UnityEngine.Debug.Log("Character.HandleInteractMsg(" + msg.GetType() + ") : target=" + this.Name);

        base.HandleInteractMsg(msg);

        // special case : this handles all messages coming from an interaction list.  
        InteractListMsg imsg = msg as InteractListMsg;
        if (imsg != null)
        {
#if DEBUG_INTERACTIONLIST
            imsg.map.Debug();
#endif
            // handle InteractionList case
            if (imsg.map.list != null)
            {
                InteractionList tmp = InteractionMgr.GetInstance().GetList(imsg.map.list);
                if (tmp != null)
                {
                    // only create a list if the current list is null or we have a list and it is interruptable
                    if (InteractionList == null || (InteractionList != null && InteractionList.Interrupt == true))
                    {
                        // make a copy
                        InteractionList = new InteractionList(imsg.map,tmp);
#if DEBUG_INTERACTIONLIST
                        UnityEngine.Debug.Log("Character.HandleInteractMsg(" + imsg.map.item + ") : Name=" + Name + "List=" + imsg.map.list);
                        InteractionList.Debug();
#endif
                        InteractionList.SetTarget(this);
                        InteractionList.Start();
                    }
                }
            }
        }
        else
        {
            // check to see if we can interrupt the list in progress with this incoming message
            if (InteractionList != null)
            {
#if DEBUG_INTERACTIONLIST
                UnityEngine.Debug.Log("Character.PutMessage(InteractMsg) : InteractionList=" + InteractionList.Name + " : Interrupt=" + InteractionList.Interrupt);
#endif
                if (InteractionList.Interrupt == true)
                    InteractionList = null;
            }
        }

        // handle InteractionList case
        if (msg.map.list != null)
        {
            InteractionList = InteractionMgr.GetInstance().GetList(msg.map.list);
            if (InteractionList != null)
            {
                // make a copy
                InteractionList = new InteractionList(msg.map, InteractionList);

#if DEBUG_INTERACTIONLIST
                UnityEngine.Debug.Log("Provider.HandleInteractMsg(" + msg.map.item + ") : Name=" + Name + "List=" + msg.map.list);
                InteractionList.Debug();
#endif

//  lets not ow that we are script driven              InteractionList.SetTarget(this);
//                InteractionList.Start();
            }
        }

    }
Пример #4
0
        public void MergeFrom(ServiceRequest other)
        {
            if (other == null)
            {
                return;
            }
            if (other.Topic.Length != 0)
            {
                Topic = other.Topic;
            }
            switch (other.TypeCase)
            {
            case TypeOneofCase.Client:
                if (Client == null)
                {
                    Client = new global::Ubii.Clients.Client();
                }
                Client.MergeFrom(other.Client);
                break;

            case TypeOneofCase.Device:
                if (Device == null)
                {
                    Device = new global::Ubii.Devices.Device();
                }
                Device.MergeFrom(other.Device);
                break;

            case TypeOneofCase.TopicSubscription:
                if (TopicSubscription == null)
                {
                    TopicSubscription = new global::Ubii.Services.Request.TopicSubscription();
                }
                TopicSubscription.MergeFrom(other.TopicSubscription);
                break;

            case TypeOneofCase.Session:
                if (Session == null)
                {
                    Session = new global::Ubii.Sessions.Session();
                }
                Session.MergeFrom(other.Session);
                break;

            case TypeOneofCase.SessionList:
                if (SessionList == null)
                {
                    SessionList = new global::Ubii.Sessions.SessionList();
                }
                SessionList.MergeFrom(other.SessionList);
                break;

            case TypeOneofCase.Interaction:
                if (Interaction == null)
                {
                    Interaction = new global::Ubii.Interactions.Interaction();
                }
                Interaction.MergeFrom(other.Interaction);
                break;

            case TypeOneofCase.InteractionList:
                if (InteractionList == null)
                {
                    InteractionList = new global::Ubii.Interactions.InteractionList();
                }
                InteractionList.MergeFrom(other.InteractionList);
                break;

            case TypeOneofCase.TopicMux:
                if (TopicMux == null)
                {
                    TopicMux = new global::Ubii.Devices.TopicMux();
                }
                TopicMux.MergeFrom(other.TopicMux);
                break;

            case TypeOneofCase.TopicMuxList:
                if (TopicMuxList == null)
                {
                    TopicMuxList = new global::Ubii.Devices.TopicMuxList();
                }
                TopicMuxList.MergeFrom(other.TopicMuxList);
                break;

            case TypeOneofCase.TopicDemux:
                if (TopicDemux == null)
                {
                    TopicDemux = new global::Ubii.Devices.TopicDemux();
                }
                TopicDemux.MergeFrom(other.TopicDemux);
                break;

            case TypeOneofCase.TopicDemuxList:
                if (TopicDemuxList == null)
                {
                    TopicDemuxList = new global::Ubii.Devices.TopicDemuxList();
                }
                TopicDemuxList.MergeFrom(other.TopicDemuxList);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Пример #5
0
        public void MergeFrom(ServiceReply other)
        {
            if (other == null)
            {
                return;
            }
            switch (other.TypeCase)
            {
            case TypeOneofCase.Success:
                if (Success == null)
                {
                    Success = new global::Ubii.General.Success();
                }
                Success.MergeFrom(other.Success);
                break;

            case TypeOneofCase.Error:
                if (Error == null)
                {
                    Error = new global::Ubii.General.Error();
                }
                Error.MergeFrom(other.Error);
                break;

            case TypeOneofCase.Client:
                if (Client == null)
                {
                    Client = new global::Ubii.Clients.Client();
                }
                Client.MergeFrom(other.Client);
                break;

            case TypeOneofCase.Device:
                if (Device == null)
                {
                    Device = new global::Ubii.Devices.Device();
                }
                Device.MergeFrom(other.Device);
                break;

            case TypeOneofCase.Server:
                if (Server == null)
                {
                    Server = new global::Ubii.Servers.Server();
                }
                Server.MergeFrom(other.Server);
                break;

            case TypeOneofCase.Session:
                if (Session == null)
                {
                    Session = new global::Ubii.Sessions.Session();
                }
                Session.MergeFrom(other.Session);
                break;

            case TypeOneofCase.SessionList:
                if (SessionList == null)
                {
                    SessionList = new global::Ubii.Sessions.SessionList();
                }
                SessionList.MergeFrom(other.SessionList);
                break;

            case TypeOneofCase.Interaction:
                if (Interaction == null)
                {
                    Interaction = new global::Ubii.Interactions.Interaction();
                }
                Interaction.MergeFrom(other.Interaction);
                break;

            case TypeOneofCase.InteractionList:
                if (InteractionList == null)
                {
                    InteractionList = new global::Ubii.Interactions.InteractionList();
                }
                InteractionList.MergeFrom(other.InteractionList);
                break;

            case TypeOneofCase.StringList:
                if (StringList == null)
                {
                    StringList = new global::Ubii.General.StringList();
                }
                StringList.MergeFrom(other.StringList);
                break;

            case TypeOneofCase.TopicMux:
                if (TopicMux == null)
                {
                    TopicMux = new global::Ubii.Devices.TopicMux();
                }
                TopicMux.MergeFrom(other.TopicMux);
                break;

            case TypeOneofCase.TopicMuxList:
                if (TopicMuxList == null)
                {
                    TopicMuxList = new global::Ubii.Devices.TopicMuxList();
                }
                TopicMuxList.MergeFrom(other.TopicMuxList);
                break;

            case TypeOneofCase.TopicDemux:
                if (TopicDemux == null)
                {
                    TopicDemux = new global::Ubii.Devices.TopicDemux();
                }
                TopicDemux.MergeFrom(other.TopicDemux);
                break;

            case TypeOneofCase.TopicDemuxList:
                if (TopicDemuxList == null)
                {
                    TopicDemuxList = new global::Ubii.Devices.TopicDemuxList();
                }
                TopicDemuxList.MergeFrom(other.TopicDemuxList);
                break;
            }

            _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }
Пример #6
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (typeCase_ == TypeOneofCase.Success)
            {
                hash ^= Success.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Error)
            {
                hash ^= Error.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Client)
            {
                hash ^= Client.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Device)
            {
                hash ^= Device.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Server)
            {
                hash ^= Server.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Session)
            {
                hash ^= Session.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.SessionList)
            {
                hash ^= SessionList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.Interaction)
            {
                hash ^= Interaction.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.InteractionList)
            {
                hash ^= InteractionList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.StringList)
            {
                hash ^= StringList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMux)
            {
                hash ^= TopicMux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicMuxList)
            {
                hash ^= TopicMuxList.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemux)
            {
                hash ^= TopicDemux.GetHashCode();
            }
            if (typeCase_ == TypeOneofCase.TopicDemuxList)
            {
                hash ^= TopicDemuxList.GetHashCode();
            }
            hash ^= (int)typeCase_;
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Пример #7
0
    public InteractionList(InteractionMap map, InteractionList list)
    {
        current = null;

        this.Map = map;
        this.Name = list.Name;
        this.Loop = list.Loop;
        this.Interrupt = list.Interrupt;

#if DEBUG_INTERACTIONLIST
        UnityEngine.Debug.Log("InteractionList() : Interaction=" + map.item + " : List=" + list.Name);
#endif

        Interactions = new List<Interaction>();
        foreach (Interaction interaction in list.Interactions)
        {
            Interactions.Add(interaction);
        }
    }