Last active
February 2, 2019 20:07
-
-
Save kosanmil/bb88a711e468732ec1d0099ae07ca4ec to your computer and use it in GitHub Desktop.
Snippet containing implementation of Unit, ProcessUnit and AgentUnit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class Unit | |
{ | |
public string Name; | |
public State State; | |
public abstract void AcceptVisitor(IVisitor visitor); | |
} | |
public class ProcessUnit : Unit | |
{ | |
public IEnumerable<Unit> ChildUnits; | |
public override void AcceptVisitor(IVisitor visitor) | |
{ | |
visitor.VisitProcessUnit(this); | |
} | |
} | |
public class AgentUnit : Unit | |
{ | |
public void SendCommand(Command command) | |
{ | |
//Implementation ommited due to simplicity of the example | |
} | |
public override void AcceptVisitor(IVisitor visitor) | |
{ | |
visitor.VisitAgentUnit(this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment