Beispiel #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");
 }
Beispiel #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");
     }
 }
Beispiel #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());
 }
Beispiel #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());
 }
Beispiel #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");
     }
 }
Beispiel #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");
     }
 }
Beispiel #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);
            }
        }
Beispiel #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");
     }
 }
Beispiel #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");
     }
 }
Beispiel #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");
     }
 }
Beispiel #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);
            }
        }
Beispiel #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");
     }
 }
Beispiel #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");
     }
 }
Beispiel #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");
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
        }