Skip to content

Commit

Permalink
Finished Milestone 3
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfschwartz committed Sep 11, 2020
1 parent db14327 commit f78e44f
Show file tree
Hide file tree
Showing 39 changed files with 1,257 additions and 162 deletions.
22 changes: 6 additions & 16 deletions Data/Drinks/AretinoAppleJuice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@ namespace BleakwindBuffet.Data.Drinks
/// <summary>
/// Class defining a AretinoAppleJuice object
/// </summary>
public class AretinoAppleJuice
public class AretinoAppleJuice : Drink, IOrderItem
{
private Size size = Size.Small;

/// <summary>
/// Get the size and set the size
/// </summary>
public Size Size
{
get { return size; }
set { size = value; }
}

/// <summary>
/// Gets price of the drink
/// </summary>
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public double Price
public override double Price
{
get
{
Expand All @@ -42,7 +32,7 @@ public double Price
case Size.Small: return 0.62;
case Size.Medium: return 0.87;
case Size.Large: return 1.01;
default: throw new NotImplementedException($"Unknown size {Size}");
default: throw new NotImplementedException($"Unknown size {size}");
}
}
}
Expand All @@ -53,7 +43,7 @@ public double Price
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public uint Calories
public override uint Calories
{
get
{
Expand All @@ -62,7 +52,7 @@ public uint Calories
case Size.Small: return 44;
case Size.Medium: return 88;
case Size.Large: return 132;
default: throw new NotImplementedException($"Unknown size {Size}");
default: throw new NotImplementedException($"Unknown size {size}");
}
}
}
Expand Down Expand Up @@ -95,7 +85,7 @@ public bool Ice
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
public override List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}
Expand Down
18 changes: 4 additions & 14 deletions Data/Drinks/CandlehearthCoffee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,15 @@ namespace BleakwindBuffet.Data.Drinks
/// <summary>
/// Class defining a CandlehearthCoffee object
/// </summary>
public class CandlehearthCoffee
public class CandlehearthCoffee : Drink, IOrderItem
{
private Size size = Size.Small;
/// <summary>
/// Get the size and set the size
/// </summary>
public Size Size
{
get { return size; }
set { size = value; }
}

/// <summary>
/// Gets price of the drink
/// </summary>
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public double Price
public override double Price
{
get
{
Expand All @@ -52,7 +42,7 @@ public double Price
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public uint Calories
public override uint Calories
{
get
{
Expand Down Expand Up @@ -133,7 +123,7 @@ public bool Decaf
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
public override List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}
Expand Down
35 changes: 35 additions & 0 deletions Data/Drinks/Drink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using BleakwindBuffet.Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace BleakwindBuffet.Data.Drinks
{
/// <summary>
/// A base class representing common properities of drinks
/// </summary>
public abstract class Drink
{
/// <summary>
/// Size of a drink, all drinks have same size options (so virtual)
/// </summary>
protected Size size = Size.Small;
public virtual Size Size { get { return size; } set { size = value; } }

/// <summary>
/// Price of a drink, always overriding these (so abstract)
/// </summary>
/// <value>In US Dollars</value>
public abstract double Price { get; }

/// <summary>
/// Calories of a drink, always overriding these (so abstract)
/// </summary>
public abstract uint Calories { get; }

/// <summary>
/// Special instructions for a drink, always overriding these (so abstract)
/// </summary>
public abstract List<string> SpecialInstructions { get; }
}
}
19 changes: 4 additions & 15 deletions Data/Drinks/MarkarthMilk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,15 @@ namespace BleakwindBuffet.Data.Drinks
/// <summary>
/// Class defining a MarkarthMilk object
/// </summary>
public class MarkarthMilk
public class MarkarthMilk : Drink, IOrderItem
{
private Size size = Size.Small;

/// <summary>
/// Get the size and set the size
/// </summary>
public Size Size
{
get { return size; }
set { size = value; }
}

/// <summary>
/// Gets price of the drink
/// </summary>
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public double Price
public override double Price
{
get
{
Expand All @@ -53,7 +42,7 @@ public double Price
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public uint Calories
public override uint Calories
{
get
{
Expand Down Expand Up @@ -95,7 +84,7 @@ public bool Ice
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
public override List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}
Expand Down
18 changes: 4 additions & 14 deletions Data/Drinks/SailorSoda.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,15 @@ namespace BleakwindBuffet.Data.Drinks
/// <summary>
/// Class defining a SailorSoda object
/// </summary>
public class SailorSoda
public class SailorSoda : Drink, IOrderItem
{
private Size size = Size.Small;
/// <summary>
/// Get the size and set the size
/// </summary>
public Size Size
{
get { return size; }
set { size = value; }
}

/// <summary>
/// Gets price of the drink
/// </summary>
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public double Price
public override double Price
{
get
{
Expand All @@ -52,7 +42,7 @@ public double Price
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public uint Calories
public override uint Calories
{
get
{
Expand Down Expand Up @@ -102,7 +92,7 @@ public SodaFlavor Flavor
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
public override List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}
Expand Down
18 changes: 4 additions & 14 deletions Data/Drinks/WarriorWater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,15 @@ namespace BleakwindBuffet.Data.Drinks
/// <summary>
/// Class defining a WarriorWater object
/// </summary>
public class WarriorWater
public class WarriorWater : Drink, IOrderItem
{
private Size size = Size.Small;
/// <summary>
/// Get the size and set the size
/// </summary>
public Size Size
{
get { return size; }
set { size = value; }
}

/// <summary>
/// The price of a drink
/// </summary>
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public double Price
public override double Price
{
get
{
Expand All @@ -52,7 +42,7 @@ public double Price
/// <exception cref="System.NotImplementedException">
/// Thrown if size is unknown
/// </exception>
public uint Calories
public override uint Calories
{
get
{
Expand Down Expand Up @@ -114,7 +104,7 @@ public bool Lemon
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
public override List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}
Expand Down
8 changes: 4 additions & 4 deletions Data/Entrees/BriarheartBurger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ namespace BleakwindBuffet.Data.Entrees
/// <summary>
/// Class defining a Briarheart Burger object
/// </summary>
public class BriarheartBurger
public class BriarheartBurger : Entree, IOrderItem
{
private double price = 6.32;
private uint calories = 743; // Uint is unsigned integer (calories can't be negative)

/// <summary>
/// Gets the price of the burger
/// </summary>
public double Price
public override double Price
{
get { return price; }
}

/// <summary>
/// Gets the number of calories
/// </summary>
public uint Calories
public override uint Calories
{
get { return calories; }
}
Expand Down Expand Up @@ -158,7 +158,7 @@ public bool Cheese
/// Gets any special instructions in cooking the burger
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<String> SpecialInstructions
public override List<String> SpecialInstructions
{
get
{
Expand Down
8 changes: 4 additions & 4 deletions Data/Entrees/DoubleDraugr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ namespace BleakwindBuffet.Data.Entrees
/// <summary>
/// Class for defining a Double Draugr object
/// </summary>
public class DoubleDraugr
public class DoubleDraugr : Entree, IOrderItem
{
private double price = 7.32;
private uint calories = 843; // Uint is unsigned integer (calories can't be negative)

/// <summary>
/// Gets the price of the burger
/// </summary>
public double Price
public override double Price
{
get { return price; }
}

/// <summary>
/// Gets the number of calories
/// </summary>
public uint Calories
public override uint Calories
{
get { return calories; }
}
Expand Down Expand Up @@ -230,7 +230,7 @@ public bool Mayo
/// Gets any special instructions in cooking the burger
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<String> SpecialInstructions
public override List<String> SpecialInstructions
{
get
{
Expand Down
28 changes: 28 additions & 0 deletions Data/Entrees/Entree.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace BleakwindBuffet.Data.Entrees
{
/// <summary>
/// A base class representing common properities of entrees
/// </summary>
public abstract class Entree
{
/// <summary>
/// Price of an entree
/// </summary>
/// <value>In US Dollars</value>
public abstract double Price { get; }

/// <summary>
/// Calories of an entree
/// </summary>
public abstract uint Calories { get; }

/// <summary>
/// Special instructions for an entree
/// </summary>
public abstract List<string> SpecialInstructions { get; }
}
}
Loading

0 comments on commit f78e44f

Please sign in to comment.