Esempio n. 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");
 }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 4
0
 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());
 }
Esempio n. 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());
 }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 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);
            }
        }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 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");
     }
 }
Esempio n. 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);
     }
 }
Esempio n. 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);
     }
 }
Esempio n. 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);
        }