Commit 9fec4c60 authored by islater's avatar islater
Browse files

asdf

parent b567dbbd
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
public class CowboyCoffe : Drink
{
/// <summary>
/// Determines the size of the drink
/// </summary>
public override Size Size { get; set; }
/// <summary>
/// Determines wether or not there is ice in the drink
/// </summary>
public override bool Ice { get; set; } = true;
/// <summary>
/// determins if the coffe will have cream or not
/// </summary>
public bool RoomForCream { get; set; } = false;
/// <summary>
/// determins if the coffe is decaf or not
/// </summary>
public bool Decaf { get; set; } = false;
/// <summary>
/// Determins the price of the drink based on the size of the drink
/// </summary>
public override double Price
{
get
{
switch (Size)
{
case (Size.Small):
return 0.60;
case (Size.Medium):
return 1.10;
case (Size.Large):
return 1.60;
}
throw new InvalidOperationException("reached size that is not allowed");
}
}
public override uint Calories
{
get
{
switch (Size)
{
case (Size.Small):
return 3;
case (Size.Medium):
return 5;
case (Size.Large):
return 7;
}
throw new InvalidOperationException("reached size that is not allowed");
}
}
public virtual List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (Ice)
{
instructions.Add("Add Ice");
}
if (RoomForCream)
{
instructions.Add("Room for Cream");
}
return instructions;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
/// <summary>
/// A base class representing a side
/// </summary>
public abstract class Drink
{
/// <summary>
/// Holds wehter or not a drink has ice
/// </summary>
public abstract bool Ice { get; set; }
/// <summary>
/// Gets the size of the drink
/// </summary>
public abstract Size Size { get; set; }
/// <summary>
/// Gets the price of the ddrink
/// </summary>
public abstract double Price { get; }
/// <summary>
/// Gets the calories of the drink
/// </summary>
public abstract uint Calories { get; }
/// <summary>
/// Skeleton parameter for the special instructions method
/// </summary>
public virtual List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (Ice)
{
instructions.Add("Hold Ice");
}
return instructions;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
public class JerkedSoda: Drink
{
/// <summary>
/// Determines the size of the drink
/// </summary>
public override Size Size { get; set; }
/// <summary>
/// Determines wether or not there is ice in the drink
/// </summary>
public override bool Ice { get; set; } = true;
public SodaFlavor Flavor { get; set; }
/// <summary>
/// Determins the price of the drink based on the size of the drink
/// </summary>
public override double Price
{
get
{
switch (Size)
{
case (Size.Small):
return 2.10;
case (Size.Medium):
return 2.10;
case (Size.Large):
return 2.59;
}
throw new InvalidOperationException("reached size that is not allowed");
}
}
public override uint Calories
{
get
{
switch (Size)
{
case (Size.Small):
return 110;
case (Size.Medium):
return 146;
case (Size.Large):
return 198;
}
throw new InvalidOperationException("reached size that is not allowed");
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
public enum SodaFlavor
{
CreamSoda,
OrangeSoda,
Sasparilla,
BirchBeer,
RootBeer
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
public class TexasTea : Drink
{
/// <summary>
/// Determines the size of the drink
/// </summary>
public override Size Size { get; set; }
/// <summary>
/// Determines wether or not there is ice in the drink
/// </summary>
public override bool Ice { get; set; } = true;
/// <summary>
/// dtermins if the Tea is seet or not
/// </summary>
public bool Sweet { get; set; } = true;
/// <summary>
/// determins if the tea has lemon in it
/// </summary>
public bool Lemon { get; set; } = false;
/// <summary>
/// Determins the price of the drink based on the size of the drink
/// </summary>
public override double Price
{
get
{
switch (Size)
{
case (Size.Small):
return 1.00;
case (Size.Medium):
return 1.50;
case (Size.Large):
return 2.00;
}
throw new InvalidOperationException("reached size that is not allowed");
}
}
/// <summary>
/// determins the calories in the drink
/// </summary>
public override uint Calories
{
get
{
if (Sweet)
{
switch (Size)
{
case (Size.Small):
return 10;
case (Size.Medium):
return 22;
case (Size.Large):
return 36;
}
throw new InvalidOperationException("reached size that is not allowed");
}
else
{
switch (Size)
{
case (Size.Small):
return 5;
case (Size.Medium):
return 11;
case (Size.Large):
return 18;
}
throw new InvalidOperationException("reached size that is not allowed");
}
}
}
public override List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (Ice)
{
instructions.Add("Hold Ice");
}
if (Lemon)
{
instructions.Add("Add Lemon");
}
return instructions;
}
}
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace CowboyCafe.Data
{
public class Water : Drink
{
/// <summary>
/// Determines the size of the drink
/// </summary>
public override Size Size { get; set; }
/// <summary>
/// Determines wether or not there is ice in the drink
/// </summary>
public override bool Ice { get; set; } = true;
/// <summary>
/// determins wether or not there is lemon in the drink
/// </summary>
public bool Lemon { get; set; } = false;
/// <summary>
/// Determins the price of the drink based on the size of the drink
/// </summary>
public override double Price
{
get
{
return 0.12;
}
}
/// <summary>
/// determins the the number of calories in the drink
/// </summary>
public override uint Calories
{
get
{
return 0;
}
}
/// <summary>
/// Determins the special intstructions for the drink
/// </summary>
public override List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (!Ice)
{
instructions.Add("Hold Ice");
}
if (Lemon)
{
instructions.Add("Lemon");
}
return instructions;
}
}
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment