2023-07-18 17:09:27 +02:00
|
|
|
using pacMan.GameStuff;
|
|
|
|
using pacMan.GameStuff.Items;
|
2023-07-12 14:07:32 +02:00
|
|
|
|
|
|
|
namespace BackendTests.TestUtils;
|
|
|
|
|
2023-07-13 14:00:42 +02:00
|
|
|
internal static class Players
|
2023-07-12 14:07:32 +02:00
|
|
|
{
|
|
|
|
internal static IPlayer Create(string colour) =>
|
|
|
|
new Player
|
|
|
|
{
|
2023-07-19 16:03:43 +02:00
|
|
|
UserName = colour,
|
2023-07-12 14:07:32 +02:00
|
|
|
Colour = colour,
|
|
|
|
PacMan = CreatePacMan(colour),
|
|
|
|
Box = CreateBox(colour)
|
|
|
|
};
|
|
|
|
|
|
|
|
internal static Character CreatePacMan(string colour) =>
|
|
|
|
new()
|
|
|
|
{
|
|
|
|
Colour = colour,
|
|
|
|
Type = CharacterType.PacMan
|
|
|
|
};
|
|
|
|
|
|
|
|
internal static Box CreateBox(string colour) =>
|
|
|
|
new()
|
|
|
|
{
|
|
|
|
Colour = colour,
|
|
|
|
Pellets = new List<Pellet>()
|
|
|
|
};
|
|
|
|
|
|
|
|
internal static IPlayer Clone(IPlayer player) =>
|
|
|
|
new Player
|
|
|
|
{
|
|
|
|
Box = player.Box,
|
|
|
|
Colour = player.Colour,
|
2023-07-19 16:03:43 +02:00
|
|
|
UserName = player.UserName,
|
2023-07-12 14:07:32 +02:00
|
|
|
PacMan = player.PacMan
|
|
|
|
};
|
|
|
|
}
|