Skip to content

Commit

Permalink
Finished Bleakwood Buffett Milestone 1
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfschwartz committed Aug 27, 2020
1 parent 41a2303 commit d265aec
Show file tree
Hide file tree
Showing 17 changed files with 2,065 additions and 2 deletions.
108 changes: 108 additions & 0 deletions Data/Drinks/ArentinoAppleJuice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Author: Matthew Schwartz
* Class name: AretineAppleJuice.cs
* Purpose: Get and set properties for a Arentino Apple Juice object
*/

using BleakwindBuffet.Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace Data.Drinks
{
public class ArentinoAppleJuice
{
private Size drinkSize = new Size();
private double price = 0;
/// <summary>
/// Gets price of the drink
/// Sets price of the drink according to the size
/// </summary>
public double Price
{
get { return price; }
set
{
if (drinkSize == Size.Small)
{
price = 0.62;
}
else if (drinkSize == Size.Medium)
{
price = 0.87;
}
else
{
price = 1.01;
}
}
}

private uint calories = 0;
/// <summary>
/// Gets the calories in a drink
/// Sets the calories in a drink based on size
/// </summary>
public uint Calories
{
get { return calories; }
set
{
if (drinkSize == Size.Small)
{
calories = 44;
}
else if (drinkSize == Size.Medium)
{
calories = 88;
}
else
{
calories = 132;
}
}
}

/// <summary>
/// Gets whether there is ice or not
/// Sets whether we want ice or not
/// Default is no ice
/// </summary>
private bool ice = false;
public bool Ice
{
get { return ice; }
set
{
if (!ice)
{
specialInstructions.Add("Add ice");
}
else
{
specialInstructions.Remove("Add ice");
}
ice = value;
}
}

/// <summary>
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}

/// <summary>
/// Overrides the ToString method to print the size
/// </summary>
/// <returns>Returns the size and flavor of the drink with the drink name</returns>
public override string ToString()
{
return $"{drinkSize} Arentino Apple Juice";
}
}
}
153 changes: 153 additions & 0 deletions Data/Drinks/CandlehearthCoffee.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
/*
* Author: Matthew Schwartz
* Class name: CandlehearthCoffee.cs
* Purpose: Get and set properties for a Candleheart Coffee object
*/

using BleakwindBuffet.Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace Data.Drinks
{
public class CandlehearthCoffee
{
private Size drinkSize = new Size();
private double price = 0;
/// <summary>
/// Gets price of the drink
/// Sets price of the drink according to the size
/// </summary>
public double Price
{
get { return price; }
set
{
if (drinkSize == Size.Small)
{
price = 0.75;
}
else if (drinkSize == Size.Medium)
{
price = 1.25;
}
else
{
price = 1.75;
}
}
}

private uint calories = 0;
/// <summary>
/// Gets the calories in a drink
/// Sets the calories in a drink based on size
/// </summary>
public uint Calories
{
get { return calories; }
set
{
if (drinkSize == Size.Small)
{
calories = 7;
}
else if (drinkSize == Size.Medium)
{
calories = 10;
}
else
{
calories = 20;
}
}
}

/// <summary>
/// Gets whether there is ice or not
/// Sets whether we want ice or not
/// Default is no ice
/// </summary>
private bool ice = false;
public bool Ice
{
get { return ice; }
set
{
if (!ice)
{
specialInstructions.Add("Add ice");
}
else
{
specialInstructions.Remove("Add ice");
}
ice = value;
}
}

/// <summary>
/// Gets whether there is room for cream or not
/// Sets whether we want room for cream or not
/// Default is no room for cream
/// </summary>
private bool roomForCream = false;
public bool RoomForCream
{
get { return roomForCream; }
set
{
if (!roomForCream)
{
specialInstructions.Add("Add cream");
}
else
{
specialInstructions.Remove("Add cream");
}
roomForCream = value;
}
}

/// <summary>
/// Gets if coffee is decaf or not
/// Sets whether we want decaf or not
/// Default is no decaf
/// </summary>
private bool decaf = false;
public bool Decaf
{
get { return decaf; }
set
{
decaf = value;
}
}

/// <summary>
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}

/// <summary>
/// Overrides the ToString method to print the size
/// </summary>
/// <returns>Returns the size and flavor of the drink with the drink name</returns>
public override string ToString()
{
if (decaf == false)
{
return $"{drinkSize} Candleheart Coffee";
}
else
{
return $"{drinkSize} Decaf Candleheart Coffee";
}
}
}
}
108 changes: 108 additions & 0 deletions Data/Drinks/MarkarthMilk.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Author: Matthew Schwartz
* Class name: MarkarthMilk.cs
* Purpose: Get and set properties for a Markarth Milk object
*/

using BleakwindBuffet.Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace Data.Drinks
{
public class MarkarthMilk
{
private Size drinkSize = new Size();
private double price = 0;
/// <summary>
/// Gets price of the drink
/// Sets price of the drink according to the size
/// </summary>
public double Price
{
get { return price; }
set
{
if (drinkSize == Size.Small)
{
price = 1.05;
}
else if (drinkSize == Size.Medium)
{
price = 1.11;
}
else
{
price = 1.22;
}
}
}

private uint calories = 0;
/// <summary>
/// Gets the calories in a drink
/// Sets the calories in a drink based on size
/// </summary>
public uint Calories
{
get { return calories; }
set
{
if (drinkSize == Size.Small)
{
calories = 56;
}
else if (drinkSize == Size.Medium)
{
calories = 72;
}
else
{
calories = 93;
}
}
}

/// <summary>
/// Gets whether there is ice or not
/// Sets whether we want ice or not
/// Default is no ice
/// </summary>
private bool ice = false;
public bool Ice
{
get { return ice; }
set
{
if (!ice)
{
specialInstructions.Add("Add ice");
}
else
{
specialInstructions.Remove("Add ice");
}
ice = value;
}
}

/// <summary>
/// Gets any special instructions
/// </summary>
private List<string> specialInstructions = new List<string>();
public List<string> SpecialInstructions
{
get { return new List<string>(specialInstructions); }
}

/// <summary>
/// Overrides the ToString method to print the size
/// </summary>
/// <returns>Returns the size and flavor of the drink with the drink name</returns>
public override string ToString()
{
return $"{drinkSize} Markarth Milk";
}
}
}
Loading

0 comments on commit d265aec

Please sign in to comment.