Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion BleakwindBuffet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Data", "Data\Data.csproj", "{B66B462C-DA57-4DB7-9053-DEBD3953F479}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataTests", "DataTests\DataTests.csproj", "{B58727B9-F783-46C8-BCC7-5122A1A4537E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataTests", "DataTests\DataTests.csproj", "{B58727B9-F783-46C8-BCC7-5122A1A4537E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PointOfSale", "PointOfSale\PointOfSale.csproj", "{FDF01E50-2943-4CD6-95AF-0F78745ABCAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "..\400WebsiteThisOne\Website\Website.csproj", "{F5DDD577-F8DF-46A4-A447-995508375564}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -21,6 +25,14 @@ Global
{B58727B9-F783-46C8-BCC7-5122A1A4537E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B58727B9-F783-46C8-BCC7-5122A1A4537E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B58727B9-F783-46C8-BCC7-5122A1A4537E}.Release|Any CPU.Build.0 = Release|Any CPU
{FDF01E50-2943-4CD6-95AF-0F78745ABCAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FDF01E50-2943-4CD6-95AF-0F78745ABCAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FDF01E50-2943-4CD6-95AF-0F78745ABCAA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FDF01E50-2943-4CD6-95AF-0F78745ABCAA}.Release|Any CPU.Build.0 = Release|Any CPU
{F5DDD577-F8DF-46A4-A447-995508375564}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F5DDD577-F8DF-46A4-A447-995508375564}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F5DDD577-F8DF-46A4-A447-995508375564}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F5DDD577-F8DF-46A4-A447-995508375564}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
109 changes: 109 additions & 0 deletions Data/Drinks/AretinoAppleJuice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* Author: John Wills
* Edited by: (Only include if you are not the original author)
* Class name: AretinoAppleJuice.cs
* Purpose: Show size options and ice for the drink
*/
using BleakwindBuffet.Data.Enums;
//using Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel; //POS 2 for xaml stuff

namespace BleakwindBuffet.Data.Drinks
{
/// <summary>
/// Properties of apple juice
/// </summary>
public class AretinoAppleJuice : Drink
{
public event PropertyChangedEventHandler PropertyChanged;//POS 2

private Size size;
/*/// <summary>
/// gets/sets size of drink
/// </summary>
public Size Size
{
get
{
return size;
}
set
{
size = value;
}
}*/

/// <summary>
/// gets/sets price depending on size
/// </summary>
/// <exception cref="System.NotImplementedException">Thrown for any unknown size</exception>
public override double Price
{
get
{
if (size == Size.Small)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Small"));
return 0.62;
}
if (size == Size.Medium)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Medium"));
return 0.87;
}
if (size == Size.Large)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Large"));
return 1.01;
}
throw new NotImplementedException();
}
}

/// <summary>
/// gets calories depending on size
/// </summary>
/// <exception cref="System.NotImplementedException">Thrown for any unknown calories</exception>
public override uint Calories
{
get
{
if (size == Size.Small) return 44;
if (size == Size.Medium) return 88;
if (size == Size.Large) return 132;
throw new NotImplementedException();
}
}

/// <summary>
/// gets/sets if they want ice
/// </summary>
public bool Ice { get; set; } = false;

/// <summary>
/// creates list of instructions for staff
/// </summary>
public override List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (Ice) instructions.Add("Add ice");
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("Ice"));
return instructions;
}
}
/// <summary>
/// Overrides the ToString() method to return the "Arentino Apple Juice" string
/// </summary>
/// <returns>size + Aretino name</returns>
public override string ToString()
{
return Size.ToString() + " Aretino Apple Juice";
}

}
}
108 changes: 108 additions & 0 deletions Data/Drinks/CandlehearthCoffee.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* Author: John Wills
* Edited by: (Only include if you are not the original author)
* Class name: CandlehearthCoffee.cs
* Purpose: Show size options and ice for the drink, with cream and decaf as options
*/
using BleakwindBuffet.Data.Enums;
//using Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace BleakwindBuffet.Data.Drinks
{
/// <summary>
/// Properties of coffee
/// </summary>
public class CandlehearthCoffee : Drink
{
private Size size;
/*/// <summary>
/// gets/sets size of drink
/// </summary>
public Size Size
{
get
{
return size;
}
set
{
size = value;
}
}*/

/// <summary>
/// gets/sets price depending on size
/// </summary>
public override double Price
{
get
{
if (size == Size.Small) return 0.75;
if (size == Size.Medium) return 1.25;
if (size == Size.Large) return 1.75;
throw new NotImplementedException();
}
}

/// <summary>
/// gets calories depending on size
/// </summary>
public override uint Calories
{
get
{
if (size == Size.Small) return 7;
if (size == Size.Medium) return 10;
if (size == Size.Large) return 20;
throw new NotImplementedException();
}
}

/// <summary>
/// gets/sets if they want ice
/// </summary>
public bool Ice { get; set; } = false;

/// <summary>
/// gets/sets if they want room for cream
/// </summary>
public bool RoomForCream { get; set; } = false;

/// <summary>
/// gets/sets if they want their coffee decaf
/// </summary>
public bool Decaf { get; set; } = false;

/// <summary>
/// creates list of instructions for staff
/// </summary>
public override List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (Ice) instructions.Add("Add ice");
if (RoomForCream) instructions.Add("Add cream");
//if (Decaf) instructions.Add("Make decaf");
return instructions;
}
}

/// <summary>
/// Overrides the ToString() method to return the "Candlehearth Coffee" string
/// </summary>
/// <returns>size + if decaf + candlehearth</returns>
public override string ToString()
{
string t1 = "";
if(Decaf)
{
t1 = " Decaf";
}
return Size.ToString() + t1 + " Candlehearth Coffee";
}
}
}
39 changes: 39 additions & 0 deletions Data/Drinks/Drink.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Author: John Wills
* Class name: Drink.cs
* Purpose: To be a BASE class for all of the drinks
*/
using BleakwindBuffet.Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace BleakwindBuffet.Data.Drinks
{
/// <summary>
/// A base class representing the common properties of Drinks
/// </summary>
public abstract class Drink : IOrderItem
{
/// <summary>
/// The size of the drink
/// </summary>
public virtual Size Size { get; set; } //ALL TEST ARE FAILING???

/// <summary>
/// The price of the drink
/// </summary>
/// <value>In US dollars</value>
public abstract double Price { get;} //abstract vs virtual
//Abstract knows going to have to override in other classes, virtual is getting away with not
/// <summary>
/// The calories of the drink
/// </summary>
public abstract uint Calories { get;}

/// <summary>
/// Special instructions to prepare the drink
/// </summary>
public abstract List<string> SpecialInstructions { get; }
}
}
93 changes: 93 additions & 0 deletions Data/Drinks/MarkarthMilk.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Author: John Wills
* Edited by: (Only include if you are not the original author)
* Class name: MarkarthMilk.cs
* Purpose: Show size options and ice for the drink
*/
using BleakwindBuffet.Data.Enums;
//using Data.Enums;
using System;
using System.Collections.Generic;
using System.Text;

namespace BleakwindBuffet.Data.Drinks
{
/// <summary>
/// Properties of milk
/// </summary>
public class MarkarthMilk : Drink
{
private Size size;
/*/// <summary>
/// gets/sets size of drink
/// </summary>
public Size Size
{
get
{
return size;
}
set
{
size = value;
}
}*/

/// <summary>
/// gets/sets price depending on size
/// </summary>
/// <exception cref="System.NotImplementedException">Thrown for any unknown price</exception>
public override double Price
{
get
{
if (size == Size.Small) return 1.05;
if (size == Size.Medium) return 1.11;
if (size == Size.Large) return 1.22;
throw new NotImplementedException();
}
}

/// <summary>
/// gets calories depending on size
/// </summary>
/// <exception cref="System.NotImplementedException">Thrown for any unknown calories</exception>
public override uint Calories
{
get
{
if (size == Size.Small) return 56;
if (size == Size.Medium) return 72;
if (size == Size.Large) return 93;
throw new NotImplementedException();
}
}

/// <summary>
/// gets/sets if they want ice
/// </summary>
public bool Ice { get; set; } = false;

/// <summary>
/// creates list of instructions for staff
/// </summary>
public override List<string> SpecialInstructions
{
get
{
List<string> instructions = new List<string>();
if (Ice) instructions.Add("Add ice");
return instructions;
}
}

/// <summary>
/// Overrides the ToString() method to return the "Markarth Milk" string
/// </summary>
/// <returns>size + markarth milk string</returns>
public override string ToString()
{
return Size.ToString() + " Markarth Milk";
}
}
}
Loading