protected override void GenerateMethod(Node node, StreamWriter stream, string indent) { SequenceStochastic sequenceStochastic = node as SequenceStochastic; Debug.Check(sequenceStochastic != null); stream.WriteLine("{0}\t\tpublic void Initialize(string method)", indent); stream.WriteLine("{0}\t\t{{", indent); stream.WriteLine("{0}\t\t\tthis.m_method = Action.LoadMethod(method);", indent); stream.WriteLine("{0}\t\t}}", indent); }
public override void GenerateInstance(Node node, StreamWriter stream, string indent, string nodeName, string agentType, string btClassName) { base.GenerateInstance(node, stream, indent, nodeName, agentType, btClassName); SequenceStochastic sequenceStochastic = node as SequenceStochastic; Debug.Check(sequenceStochastic != null); if (sequenceStochastic.RandomGenerator != null) { string method = sequenceStochastic.RandomGenerator.GetExportValue().Replace("\"", "\\\""); stream.WriteLine("{0}\t{1}.Initialize(\"{2}\");", indent, nodeName, method); } }
protected override void GenerateMethod(Node node, StreamWriter stream, string indent) { SequenceStochastic seq = node as SequenceStochastic; if (seq == null) { return; } stream.WriteLine("{0}\tpublic:", indent); stream.WriteLine("{0}\t\tvoid Initialize(const char* method)", indent); stream.WriteLine("{0}\t\t{{", indent); stream.WriteLine("{0}\t\t\tthis->m_method = Action::LoadMethod(method);", indent); stream.WriteLine("{0}\t\t}}", indent); }
protected override void GenerateMethod(Node node, StringWriter stream, string indent) { SequenceStochastic seq = node as SequenceStochastic; if (seq == null) { return; } if (seq.RandomGenerator != null) { stream.WriteLine("{0}\t\tpublic void Initialize(string method)", indent); stream.WriteLine("{0}\t\t{{", indent); stream.WriteLine("{0}\t\t\tthis.m_method = AgentMeta.ParseMethod(method);", indent); stream.WriteLine("{0}\t\t}}", indent); } }
protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className) { base.GenerateConstructor(node, stream, indent, className); SequenceStochastic seq = node as SequenceStochastic; if (seq == null) { return; } if (seq.RandomGenerator != null) { stream.WriteLine("{0}\t\t\tthis.Initialize(\"{1}\");", indent, seq.RandomGenerator.GetExportValue()); } }
protected override bool ShouldGenerateClass(Node node) { SequenceStochastic seq = node as SequenceStochastic; return(seq != null); }