/// <summary> /// Sorts all PortConfigAttributes into input and output values, for FlowNode configuration. /// </summary> public override void GetConfiguration(SFlowNodeConfig cfg) { SetupInputPorts(cfg, Node.Inputs); SetupOutputPorts(cfg, Node.Outputs); cfg.SetDescription(Node.Description); cfg.SetCategory((int)EFlowNodeFlags.EFLN_APPROVED); }
/// <summary> /// Passes information about output port configuration along to CryEngine. /// </summary> /// <param name="cfg">Configuration struct to be filled with information.</param> /// <param name="ports">Definition of output ports.</param> protected void SetupOutputPorts(SFlowNodeConfig cfg, List <PortConfig> ports) { cfg.SetOutputSize(ports.Count); for (int i = 0; i < ports.Count; i++) { var t = ports [i].PropertyType; if (t == typeof(string)) { cfg.AddStringOutputPort(i, ports[i].Name, ports[i].Description); } else if (t == typeof(Signal)) { cfg.AddVoidOutputPort(i, ports[i].Name, ports[i].Description); } else if (t == typeof(int)) { cfg.AddIntOutputPort(i, ports[i].Name, ports[i].Description); } else if (t == typeof(bool)) { cfg.AddBoolOutputPort(i, ports[i].Name, ports[i].Description); } } }