コード例 #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
ファイル: StateGraphDocument.cs プロジェクト: michyer/canape
        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
ファイル: StateGraphDocument.cs プロジェクト: michyer/canape
        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
ファイル: StateGraphDocument.cs プロジェクト: michyer/canape
        /// <summary>
        /// Remove an entry
        /// </summary>
        /// <param name="entry">The entry to remove</param>
        public void RemoveEntry(StateGraphEntry entry)
        {
            _entries.Remove(entry);

            UpdateStates();
        }
コード例 #7
0
ファイル: StateGraphDocument.cs プロジェクト: michyer/canape
        /// <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();
        }