-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStartedGame.cs
More file actions
43 lines (37 loc) · 1.03 KB
/
StartedGame.cs
File metadata and controls
43 lines (37 loc) · 1.03 KB
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
using System;
using System.Collections.Generic;
using System.Text;
namespace StateAndCommand
{
class StartedGame : GameState
{
public StartedGame(GameState state) : this(state.Game) { }
public StartedGame(Game game)
{
this._game = game;
Initialize();
}
public override void BuyGame()
{
Console.WriteLine("You already own {0}.", _game.Name);
}
public override void DeleteGame()
{
Console.WriteLine("Please exit the game first.", _game.Name);
}
public override void InstallGame()
{
Console.WriteLine("{0} is already installed.", _game.Name);
}
public override void StartGame()
{
Console.WriteLine("{0} is running already.", _game.Name);
}
private void Initialize()
{
_isOwned = true;
_isInstalled = true;
_isPlaying = true;
}
}
}