Пример #1
0
        private void AddStateFromEntry(NetGraphBuilder builder, StateGraphEntry entry, BaseNodeFactory inputNode, BaseNodeFactory outputNode, bool clientToServer)
        {
            BaseNodeFactory currentFactory;

            if (entry.Graph != null)
            {
                currentFactory = builder.AddNode(new NetGraphContainerNodeFactory(String.Format("{0} {1}", entry.StateName,
                                                                                                GetDirection(clientToServer)), Guid.NewGuid(), entry.Graph.Factory,
                                                                                  clientToServer ? NetGraphContainerNode.GraphDirection.ClientToServer : NetGraphContainerNode.GraphDirection.ServerToClient));
                currentFactory.Hidden = true;

                builder.AddLine(inputNode, currentFactory, entry.StateName);
            }
            else
            {
                currentFactory = inputNode;
            }

            if (entry.LogPackets)
            {
                LogPacketNodeFactory log = builder.AddLog(String.Format("{0} Log {1}", entry.StateName, GetDirection(clientToServer)),
                                                          Guid.NewGuid(), entry.Color, null, false);
                log.Hidden = true;

                builder.AddLine(currentFactory, log, null);

                currentFactory = log;
            }

            builder.AddLine(currentFactory, outputNode, null);
        }
Пример #2
0
        /// <summary>
        /// Add a state entry
        /// </summary>
        /// <returns>The new entry</returns>
        public StateGraphEntry AddEntry()
        {
            StateGraphEntry entry = new StateGraphEntry(this);

            _entries.Add(entry);

            UpdateStates();

            return(entry);
        }
Пример #3
0
        private LogPacketNodeFactory AddLog(NetGraphBuilder builder, StateGraphEntry entry, BaseNodeFactory currentFactory, bool clientToServer)
        {
            LogPacketNodeFactory log = builder.AddLog(String.Format("{0} Log {1}", entry.StateName,
                                                                    GetDirection(clientToServer)), Guid.NewGuid(), entry.Color, null, false);

            log.Hidden = true;

            builder.AddLine(currentFactory, log, null);

            return(log);
        }
Пример #4
0
        private void AddStateFromEntry(NetGraphBuilder builder, StateGraphEntry entry, BaseNodeFactory inputNode, BaseNodeFactory outputNode, bool clientToServer)
        {
            BaseNodeFactory currentFactory;

            if (entry.Graph != null)
            {
                currentFactory = builder.AddNode(new NetGraphContainerNodeFactory(String.Format("{0} {1}", entry.StateName,
                    GetDirection(clientToServer)), Guid.NewGuid(), entry.Graph.Factory,
                    clientToServer ? NetGraphContainerNode.GraphDirection.ClientToServer : NetGraphContainerNode.GraphDirection.ServerToClient));
                currentFactory.Hidden = true;

                builder.AddLine(inputNode, currentFactory, entry.StateName);
            }
            else
            {
                currentFactory = inputNode;
            }

            if (entry.LogPackets)
            {
                LogPacketNodeFactory log = builder.AddLog(String.Format("{0} Log {1}", entry.StateName, GetDirection(clientToServer)),
                    Guid.NewGuid(), entry.Color, null, false);
                log.Hidden = true;

                builder.AddLine(currentFactory, log, null);

                currentFactory = log;
            }

            builder.AddLine(currentFactory, outputNode, null);
        }
Пример #5
0
        private LogPacketNodeFactory AddLog(NetGraphBuilder builder, StateGraphEntry entry, BaseNodeFactory currentFactory, bool clientToServer)
        {
            LogPacketNodeFactory log = builder.AddLog(String.Format("{0} Log {1}", entry.StateName,
                GetDirection(clientToServer)), Guid.NewGuid(), entry.Color, null, false);
            log.Hidden = true;

            builder.AddLine(currentFactory, log, null);

            return log;
        }
Пример #6
0
        /// <summary>
        /// Remove an entry
        /// </summary>
        /// <param name="entry">The entry to remove</param>
        public void RemoveEntry(StateGraphEntry entry)
        {
            _entries.Remove(entry);

            UpdateStates();
        }
Пример #7
0
        /// <summary>
        /// Add a state entry
        /// </summary>
        /// <returns>The new entry</returns>
        public StateGraphEntry AddEntry()
        {
            StateGraphEntry entry = new StateGraphEntry(this);
            _entries.Add(entry);

            UpdateStates();

            return entry;
        }
Пример #8
0
        /// <summary>
        /// Remove an entry
        /// </summary>
        /// <param name="entry">The entry to remove</param>
        public void RemoveEntry(StateGraphEntry entry)
        {
            _entries.Remove(entry);

            UpdateStates();
        }