当前位置: 首页>>代码示例>>C#>>正文


C# Animal.GetMeatFromKillQuantity方法代码示例

本文整理汇总了C#中Animal.GetMeatFromKillQuantity方法的典型用法代码示例。如果您正苦于以下问题:C# Animal.GetMeatFromKillQuantity方法的具体用法?C# Animal.GetMeatFromKillQuantity怎么用?C# Animal.GetMeatFromKillQuantity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Animal的用法示例。


在下文中一共展示了Animal.GetMeatFromKillQuantity方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TryEatAnimal

 // Method
 public int TryEatAnimal(Animal animal)
 {
     if (animal != null && (animal.Size <= this.Size || animal.State == AnimalState.Sleeping))
     {
         return animal.GetMeatFromKillQuantity();
     }
     return 0;
 }
开发者ID:Termininja,项目名称:BGCoder,代码行数:9,代码来源:Wolf.cs

示例2: TryEatAnimal

 // Methods
 public int TryEatAnimal(Animal animal)
 {
     if (animal != null && animal.Size <= this.Size)
     {
         return animal.GetMeatFromKillQuantity();
     }
     return 0;
 }
开发者ID:Termininja,项目名称:BGCoder,代码行数:9,代码来源:Boar.cs

示例3: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            if (animal != null && (animal.Size <= BoarDefaultSize))
            {
                return animal.GetMeatFromKillQuantity();
            }

            return 0;
        }
开发者ID:NikolaPineda,项目名称:Telerik,代码行数:9,代码来源:Boar.cs

示例4: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            if (this.Size >= animal.Size || animal.State == AnimalState.Sleeping ||)
            {
                return animal.GetMeatFromKillQuantity();
            }

            return 0;
        }
开发者ID:dirk-dagger-667,项目名称:telerik-c--OOP-exam-prep,代码行数:9,代码来源:Wolf.cs

示例5: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            int meatEaten = 0;
            if (animal != null && animal.Size <= base.Size)
            {
                meatEaten = animal.GetMeatFromKillQuantity();
            }

            return meatEaten;
        }
开发者ID:evlogihr,项目名称:TelerikAcademy-Exercises,代码行数:10,代码来源:Boar.cs

示例6: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            if (animal != null && (animal.Size <= (this.Size * 2)))
            {
                this.Size += 1;
                return animal.GetMeatFromKillQuantity();
            }

            return 0;
        }
开发者ID:NikolaPineda,项目名称:Telerik,代码行数:10,代码来源:Lion.cs

示例7: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            if(animal != null)
            {
                if(animal.Size <= this.Size * 2)
                {
                    this.Size++;
                    return animal.GetMeatFromKillQuantity();
                }
            }

            return 0;
        }
开发者ID:TeeeeeC,项目名称:TelerikAcademy2015-2016,代码行数:13,代码来源:Lion.cs

示例8: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            if (animal != null)
            {
                if (this.Size >= 2 * animal.Size || animal.State == AnimalState.Sleeping)
                {
                    this.Size += 1;
                    return animal.GetMeatFromKillQuantity();
                }
            }

            return 0;
        }
开发者ID:dirk-dagger-667,项目名称:telerik-c--OOP-exam-prep,代码行数:13,代码来源:Lion.cs

示例9: TryEatAnimal

        public int TryEatAnimal(Animal animal)
        {
            if (animal != null)
            {
                var meatEaten = 0;
                if (this.Size >= animal.Size || animal.State == AnimalState.Sleeping)
                {
                    meatEaten = animal.GetMeatFromKillQuantity();
                }

                return meatEaten;
            }
            return 0;
        }
开发者ID:tima-t,项目名称:Telerik-Academy,代码行数:14,代码来源:Wolf.cs

示例10: TryEatAnimal

    public int TryEatAnimal(Animal animal)
    {
        if (animal != null)
        {
            if (this.Size >= animal.Size || animal.State.Equals(AnimalState.Sleeping))
            {
                return animal.GetMeatFromKillQuantity();
            }
        }

        return 0;
    }
开发者ID:jesconsa,项目名称:Telerik-Academy,代码行数:12,代码来源:02.+Ecosystem+Simulation+API.cs


注:本文中的Animal.GetMeatFromKillQuantity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。