-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacterFactory.cs
More file actions
32 lines (27 loc) · 989 Bytes
/
CharacterFactory.cs
File metadata and controls
32 lines (27 loc) · 989 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
namespace Maze
{
public class CharacterFactory: ICharacterFactory
{
// Создание и инициализация персонажа игрока
public ICharacter CreatePlayerCharacter(LevelForm parent)
{
return new PlayerCharacter(parent);
}
// Создание и инициализация персонажей, управляемых компьютером
public List<ICharacter> CreateComputerCharacters(LevelForm parent, int count)
{
List<ICharacter> computerCharacters = new List<ICharacter>();
for (int i = 0; i < count; i++)
{
computerCharacters.Add(new PCCharacter(parent));
}
return computerCharacters;
}
}
}