Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private Type behaviour;
- private string name;
- // each of the states needs to know where to go
- Dictionary<ASymbol, AState> transition;
- // property
- // - equivalent to get/set methods
- public string Name {
- get {
- return name;
- }
- }
- public Type Behaviour{
- get{
- return behaviour;
- }
- }
- public AState(string name, Type behaviour){
- this.name = name;
- this.behaviour = behaviour;
- transition = new Dictionary<ASymbol, AState> ();
- }
- public void AddTransition(ASymbol key, AState value){
- transition.Add (key, value);
- }
- public AState ApplySymbol(ASymbol key){
- if(transition.ContainsKey(key))
- return transition[key];
- return this;
- }
- private string name;
- public string Name{
- get{
- return name;
- }
- }
- public ASymbol(string name){
- this.name = name;
- }
Add Comment
Please, Sign In to add comment