Skip to content

Commit 68249cf

Browse files
committed
milestone ksu-cis#2 progress
1 parent c566a34 commit 68249cf

40 files changed

+1728
-115
lines changed

Data/Drinks/AretinoAppleJuice.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,42 @@ public class AretinoAppleJuice : Drink, IOrderItem, INotifyPropertyChanged
1818

1919
{
2020
/// <summary>
21-
///
21+
/// propertychanged event handler
2222
/// </summary>
2323
public event PropertyChangedEventHandler PropertyChanged;
2424

2525

26+
/// <summary>
27+
/// notify property helper method
28+
/// </summary>
29+
/// <param name="propertyName"></param>
2630
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "" )
2731
{
2832
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
2933
}
34+
35+
3036
/// <summary>
3137
/// Gets the price of the juice
3238
/// </summary>
3339
double price;
3440

41+
public Size Size
42+
{
43+
get
44+
{
45+
return this.size;
46+
}
47+
set
48+
{
49+
if (value != this.size)
50+
{
51+
this.size = value;
52+
NotifyPropertyChanged();
53+
}
54+
}
55+
}
56+
3557
/// <summary>
3658
/// private variable declaration
3759
/// </summary>
@@ -99,7 +121,9 @@ public bool Ice
99121
NotifyPropertyChanged();
100122
}
101123
}
102-
}
124+
}
125+
126+
103127

104128
private bool ice = false;
105129
/// <summary>

Data/Drinks/CandlehearthCoffee.cs

Lines changed: 89 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Runtime.CompilerServices;
35
using System.Text;
46
using BleakwindBuffet.Data.Enums;
57

@@ -11,9 +13,22 @@
1113
namespace BleakwindBuffet.Data.Drinks
1214
{
1315

14-
public class CandlehearthCoffee : Drink, IOrderItem
16+
public class CandlehearthCoffee : Drink, IOrderItem, INotifyPropertyChanged
1517
{
18+
/// <summary>
19+
/// propertychanged event handler
20+
/// </summary>
21+
public event PropertyChangedEventHandler PropertyChanged;
1622

23+
24+
/// <summary>
25+
/// notify property helper method
26+
/// </summary>
27+
/// <param name="propertyName"></param>
28+
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
29+
{
30+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
31+
}
1732
/// <summary>
1833
/// Gets the price of the coffee
1934
/// </summary>
@@ -43,7 +58,26 @@ public override double Price
4358
/// <summary>
4459
/// Gets the Size of the coffee with it being a default of small
4560
/// </summary>
46-
public Size Size { get; set; } = Size.Small;
61+
public Size Size
62+
{
63+
get
64+
{
65+
return this.size;
66+
}
67+
set
68+
{
69+
if (value != this.size)
70+
{
71+
this.size = value;
72+
NotifyPropertyChanged();
73+
}
74+
}
75+
}
76+
77+
/// <summary>
78+
/// private variable declaration
79+
/// </summary>
80+
private Size size = Size.Small;
4781

4882
/// <summary>
4983
/// Gets the calories of the coffee based on size
@@ -70,17 +104,67 @@ public override uint Calories
70104
/// <summary>
71105
/// Gets whether or not to add ice
72106
/// </summary>
73-
public bool Ice { get; set; } = false;
107+
public bool Ice
108+
{
109+
get
110+
{
111+
return this.ice;
112+
}
113+
set
114+
{
115+
if (value != this.ice)
116+
{
117+
this.ice = value;
118+
NotifyPropertyChanged();
119+
}
120+
}
121+
}
122+
123+
124+
125+
private bool ice = false;
74126

75127
/// <summary>
76128
/// gets whether or not leave room for cream
77129
/// </summary>
78-
public bool RoomForCream { get; set; } = false;
130+
public bool RoomForCream
131+
{
132+
get
133+
{
134+
return this.roomForcream;
135+
}
136+
set
137+
{
138+
if (value != this.roomForcream)
139+
{
140+
this.roomForcream = value;
141+
NotifyPropertyChanged();
142+
}
143+
}
144+
}
145+
146+
79147

148+
private bool roomForcream = false;
80149
/// <summary>
81150
/// gets whether they want it Decaf or not
82151
/// </summary>
83-
public bool Decaf { get; set; } = false;
152+
public bool Decaf
153+
{
154+
get
155+
{
156+
return this.decaf;
157+
}
158+
set
159+
{
160+
if (value != this.decaf)
161+
{
162+
this.decaf = value;
163+
NotifyPropertyChanged();
164+
}
165+
}
166+
}
167+
private bool decaf = false;
84168

85169
/// <summary>
86170
/// Allows customization on the coffee

Data/Drinks/MarkarthMilk.cs

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Runtime.CompilerServices;
35
using System.Text;
46
using BleakwindBuffet.Data.Enums;
57

@@ -11,9 +13,25 @@
1113
namespace BleakwindBuffet.Data.Drinks
1214
{
1315

14-
public class MarkarthMilk : Drink, IOrderItem
16+
public class MarkarthMilk : Drink, IOrderItem, INotifyPropertyChanged
1517
{
1618

19+
20+
/// <summary>
21+
/// propertychanged event handler
22+
/// </summary>
23+
public event PropertyChangedEventHandler PropertyChanged;
24+
25+
26+
/// <summary>
27+
/// notify property helper method
28+
/// </summary>
29+
/// <param name="propertyName"></param>
30+
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
31+
{
32+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
33+
}
34+
1735
/// <summary>
1836
/// Gets the price of the milk
1937
/// </summary>
@@ -43,7 +61,26 @@ public override double Price
4361
/// <summary>
4462
/// Gets the Size of the milk with it being a default of small
4563
/// </summary>
46-
64+
public Size Size
65+
{
66+
get
67+
{
68+
return this.size;
69+
}
70+
set
71+
{
72+
if (value != this.size)
73+
{
74+
this.size = value;
75+
NotifyPropertyChanged();
76+
}
77+
}
78+
}
79+
80+
/// <summary>
81+
/// private variable declaration
82+
/// </summary>
83+
private Size size = Size.Small;
4784

4885
/// <summary>
4986
/// Gets the calories of the milk based on size
@@ -65,12 +102,30 @@ public override uint Calories
65102
}
66103
}
67104

68-
105+
69106

70107
/// <summary>
71108
/// Gets whether or not to add ice
72109
/// </summary>
73-
public bool Ice { get; set; } = false;
110+
public bool Ice
111+
{
112+
get
113+
{
114+
return this.ice;
115+
}
116+
set
117+
{
118+
if (value != this.ice)
119+
{
120+
this.ice = value;
121+
NotifyPropertyChanged();
122+
}
123+
}
124+
}
125+
126+
127+
128+
private bool ice = false;
74129

75130
/// <summary>
76131
/// Allows customization on the milk

Data/Drinks/SailorSoda.cs

Lines changed: 70 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Runtime.CompilerServices;
35
using System.Text;
46
using BleakwindBuffet.Data.Enums;
57

@@ -12,9 +14,21 @@
1214
namespace BleakwindBuffet.Data.Drinks
1315
{
1416

15-
public class SailorSoda: Drink, IOrderItem
17+
public class SailorSoda: Drink, IOrderItem, INotifyPropertyChanged
1618
{
19+
/// propertychanged event handler
20+
/// </summary>
21+
public event PropertyChangedEventHandler PropertyChanged;
22+
1723

24+
/// <summary>
25+
/// notify property helper method
26+
/// </summary>
27+
/// <param name="propertyName"></param>
28+
private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
29+
{
30+
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
31+
}
1832
/// <summary>
1933
/// Gets the price of the soda
2034
/// </summary>
@@ -44,8 +58,27 @@ public override double Price
4458
/// <summary>
4559
/// Gets the Size of the soda with it being a default of small
4660
/// </summary>
47-
public Size Size { get; set; } = Size.Small;
48-
61+
public Size Size
62+
{
63+
get
64+
{
65+
return this.size;
66+
}
67+
set
68+
{
69+
if (value != this.size)
70+
{
71+
this.size = value;
72+
NotifyPropertyChanged();
73+
}
74+
}
75+
}
76+
77+
/// <summary>
78+
/// private variable declaration
79+
/// </summary>
80+
private Size size = Size.Small;
81+
4982
/// <summary>
5083
/// Gets the calories of the soda based on size
5184
/// </summary>
@@ -69,13 +102,44 @@ public override uint Calories
69102
/// <summary>
70103
/// Gets the flavor of the soda
71104
/// </summary>
72-
public SodaFlavor Flavor { get; set; }
105+
public SodaFlavor Flavor
106+
{
107+
get
108+
{
109+
return this.flavor;
110+
}
73111

112+
set
113+
{
114+
if(value != this.flavor)
115+
{
116+
this.flavor = value;
117+
NotifyPropertyChanged();
118+
}
119+
}
120+
}
121+
private SodaFlavor flavor = SodaFlavor.Cherry;
74122
/// <summary>
75123
/// Gets whether or not to add ice
76124
/// </summary>
77-
public bool Ice { get; set; } = true;
78-
125+
public bool Ice
126+
{
127+
get
128+
{
129+
return this.ice;
130+
}
131+
set
132+
{
133+
if (value != this.ice)
134+
{
135+
this.ice = value;
136+
NotifyPropertyChanged();
137+
}
138+
}
139+
}
140+
141+
private bool ice = true;
142+
79143
/// <summary>
80144
/// Allows customization on the soda
81145
/// </summary>

0 commit comments

Comments
 (0)