Exemplo n.º 1
0
 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!");
     }
 }
Exemplo n.º 2
0
        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);
            }
        }