public static IBehavior Create(string behaviorType) { switch (behaviorType) { case "Inflated": IBehavior behavior = new InflatedBehavior(); return behavior; case "Aggressive": behavior = new AggressiveBehavior(); return behavior; default: throw new NotImplementedException("Unknoun type behavior!"); } }
public IBehavior CreateBehavior(string behaviorType) { IBehavior behavior; switch (behaviorType) { case "Aggressive": behavior = new AggresiveBehavior(); return(behavior); case "Inflated": behavior = new InflatedBehavior(); return(behavior); default: throw new BehaviorNotImplementedException(Messages.Messages.BehaviorNotImplemented); } }