-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathState.cs
34 lines (28 loc) · 774 Bytes
/
State.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
namespace DoFactory.GangOfFour.State.RealWorld
{
/// <summary>
/// The 'State' abstract class
/// </summary>
public abstract class State
{
protected Account account;
protected double balance;
protected double interest;
protected double lowerLimit;
protected double upperLimit;
// Properties
public Account Account
{
get { return account; }
set { account = value; }
}
public double Balance
{
get { return balance; }
set { balance = value; }
}
public abstract void Deposit(double amount);
public abstract void Withdraw(double amount);
public abstract void PayInterest();
}
}