Example #1
0
 public string Move(Environment env)
 {
     if (env == Environment.Land)
     {
         return(this.Crawl());
     }
     return($"{this.Name} is a Snake and can't move in {env} environment");
 }
Example #2
0
 public string Move(Environment environment)
 {
     if (environment == Environment.Land)
     {
         return(Crawl());
     }
     else
     {
         return($"{this.Name} is a {nameof(Snake)} and can't move in {environment} environment");
     }
 }
Example #3
0
 public string Move(Environment environment)
 {
     if (environment == Environment.Air)
     {
         return(Fly());
     }
     else
     {
         return($"{this.Name} is a {nameof(Crow)} and can't move in {environment} environment");
     }
 }
 public string Move(Environment env)
 {
     if (env == Environment.Air)
     {
         return($"{this.Name} is a Frog and can't move in Air environment");
     }
     else if (env == Environment.Land)
     {
         return(this.Walk());
     }
     return(this.Swim());
 }
Example #5
0
 public string Move(Environment env)
 {
     if (env == Environment.Watery)
     {
         return($"{this.Name} is a Crow and can't move in Watery environment");
     }
     else if (env == Environment.Land)
     {
         return($"{this.Name} is a Crow and can't move in Land environment");
     }
     return(this.Fly());
 }
Example #6
0
 /// <summary>
 /// Move Method talking about the movement abilities of the Snake
 /// </summary>
 /// <param name="env"></param>
 /// <returns></returns>
 public string Move(Environment env)
 {
     if ((int)env == 0)
     {
         return(Crawl());
     }
     else if ((int)env == 1)
     {
         return($"{Name} is a {typeof(Snake).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Watery)} environment");
     }
     else
     {
         return($"{Name} is a {typeof(Snake).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Air)} environment");
     }
 }
Example #7
0
 public string Move(Environment environment)
 {
     if (environment == Environment.Land)
     {
         return(Walk());
     }
     else if (environment == Environment.Air)
     {
         return(Fly());
     }
     else
     {
         return($"{this.Name} is a {nameof(Partridge)} and can't move in {environment} environment");
     }
 }
Example #8
0
        public string Move(Environment moveType)
        {
            string output = string.Empty;

            if (moveType == Environment.Land)
            {
                return(this.Crawl());
            }
            else
            {
                output = Name + " is a Snake and can't move in " +
                         moveType.ToString() + " environment";
                return(output);
            }
        }
Example #9
0
 public string Move(Environment environment)
 {
     if (Environment.Watery == environment)
     {
         return(Swim());
     }
     if (environment == Environment.Land)
     {
         return(Walk());
     }
     else
     {
         return($"{this.Name} is a {typeof(Frog).Name} and can't move in {Enum.GetName(typeof(E1.Enums.Environment), E1.Enums.Environment.Air)} environment");
     }
 }
Example #10
0
 /// <summary>
 /// Move Method talking about the movement abilities of the Crow
 /// </summary>
 /// <param name="env"></param>
 /// <returns></returns>
 public string Move(Environment env)
 {
     if ((int)env == 2)
     {
         return(Fly());
     }
     else if ((int)env == 0)
     {
         return($"{Name} is a {typeof(Crow).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Land)} environment");
     }
     else
     {
         return($"{Name} is a {typeof(Crow).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Watery)} environment");
     }
 }
Example #11
0
 /// <summary>
 /// Move Method talking about the movement abilities of the frog
 /// </summary>
 /// <param name="env"></param>
 /// <returns></returns>
 public string Move(Environment env)
 {
     if ((int)env == 0)
     {
         return(Walk());
     }
     else if ((int)env == 1)
     {
         return(Swim());
     }
     else
     {
         return($"{Name} is a {typeof(Frog).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Air)} environment");
     }
 }
Example #12
0
        public string Move(Environment moveType)
        {
            string output = string.Empty;

            if (moveType == Environment.Air)
            {
                return(this.Fly());
            }
            else
            {
                output = Name + " is a Crow and can't move in " +
                         moveType.ToString() + " environment";
                return(output);
            }
        }
Example #13
0
 public string Move(Environment environment)
 {
     if (environment == Environment.Land)
     {
         return(Crawl());
     }
     if (environment == Environment.Air)
     {
         return($"{this.Name} is a {typeof(Snake).Name} and can't move in {Enum.GetName(typeof(E1.Enums.Environment), E1.Enums.Environment.Air)} environment");
     }
     else
     {
         return($"{this.Name} is a {typeof(Snake).Name} and can't move in {Enum.GetName(typeof(E1.Enums.Environment), E1.Enums.Environment.Watery)} environment");
     }
 }
Example #14
0
 public string Move(Environment environment)
 {
     if (environment == Environment.Land)
     {
         return(Walk());
     }
     else if (environment == Environment.Watery)
     {
         return(Swim());
     }
     else
     {
         return($"{this.Name} is a {nameof(Frog)} and can't move in {environment} environment");
     }
 }
Example #15
0
 public string Move(Environment environment)
 {
     if (environment == Environment.Air)
     {
         return(Fly());
     }
     if (environment == Environment.Watery)
     {
         return($"{this.Name} is a {typeof(Crow).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Watery)} environment");
     }
     else
     {
         return
             ($"{this.Name} is a {typeof(Crow).Name} and can't move in {Enum.GetName(typeof(Environment), Environment.Land)} environment");
     }
 }
Example #16
0
 public string Move(Environment moveType)
 {
     if (moveType == Environment.Land)
     {
         return(this.Walk());
     }
     else if (moveType == Environment.Air)
     {
         return(this.Fly());
     }
     else
     {
         string output = Name + " is a Partridge and can't move in " +
                         moveType.ToString() + " environment";
         return(output);
     }
 }
Example #17
0
 public string Move(Environment moveType)
 {
     if (moveType == Environment.Land)
     {
         return(this.Walk());
     }
     else if (moveType == Environment.Watery)
     {
         return(this.Swim());
     }
     else
     {
         string output = Name + " is a Frog and can't move in " +
                         moveType.ToString() + " environment";
         return(output);
     }
 }
Example #18
0
        public string Move(Environment environment)
        {
            string result = null;

            if (environment == Environment.Watery)
            {
                result = this.Name + " is a Partridge and can't move in " + environment + " environment";
            }
            else if (environment == Environment.Land)
            {
                result = Walk();
            }
            else
            {
                result = Fly();
            }

            return(result);
        }