コード例 #1
0
        public override int GetHashCode()
        {
            var hashCode = 1947966917;

            hashCode = hashCode * -1521134295 + DrinkType.GetHashCode();
            hashCode = hashCode * -1521134295 + _sugarCount.GetHashCode();
            hashCode = hashCode * -1521134295 + HasStick.GetHashCode();
            hashCode = hashCode * -1521134295 + Message.GetHashCode();
            return(hashCode);
        }
コード例 #2
0
        public static Drink MakeDrink(DrinkType type, DrinkFlavor flavor, DrinkSize size)
        {
            var delay = (flavor.GetHashCode() + size.GetHashCode() + (type.GetHashCode() * 2)) * 300;

            Thread.Sleep(delay);
            return(new Drink
            {
                Id = Guid.NewGuid(),
                Flavor = flavor,
                Size = size,
                Type = type
            });
        }