-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.cs
More file actions
50 lines (42 loc) · 1021 Bytes
/
Game.cs
File metadata and controls
50 lines (42 loc) · 1021 Bytes
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.Text;
namespace StateAndCommand
{
//Games track their State and allow for the State Methods. Error handling is done in the latter.
public class Game
{
private GameState _state;
private String _name;
public Game(string name)
{
_name = name;
_state = new UnownedGame(this);
}
public String Name
{
get { return _name; }
}
public GameState State
{
get { return _state; }
set { _state = value; }
}
public void BuyGame()
{
_state.BuyGame();
}
public void InstallGame()
{
_state.InstallGame();
}
public void DeleteGame()
{
_state.DeleteGame();
}
public void StartGame()
{
_state.StartGame();
}
}
}