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); }
/// <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); }
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); }
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; }
/// <summary> /// Remove an entry /// </summary> /// <param name="entry">The entry to remove</param> public void RemoveEntry(StateGraphEntry entry) { _entries.Remove(entry); UpdateStates(); }
/// <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; }