Skip to content

Instantly share code, notes, and snippets.

@kosanmil
Last active February 2, 2019 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kosanmil/a84b1f3a6c655dcc4a1c10321b7e6972 to your computer and use it in GitHub Desktop.
Save kosanmil/a84b1f3a6c655dcc4a1c10321b7e6972 to your computer and use it in GitHub Desktop.
public class StartUnitVisitor : IVisitor
{
public void VisitProcessUnit(ProcessUnit unit)
{
foreach (var childUnit in unit.ChildUnits)
childUnit.AcceptVisitor(this);
}
public void VisitAgentUnit(AgentUnit unit)
{
unit.SendCommand(Command.Start);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment