ActionService tests and Equality
This commit is contained in:
40
BackendTests/TestUtils/Players.cs
Normal file
40
BackendTests/TestUtils/Players.cs
Normal file
@ -0,0 +1,40 @@
|
||||
using pacMan.Game;
|
||||
using pacMan.Game.Interfaces;
|
||||
using pacMan.Game.Items;
|
||||
|
||||
namespace BackendTests.TestUtils;
|
||||
|
||||
public class Players
|
||||
{
|
||||
internal static IPlayer Create(string colour) =>
|
||||
new Player
|
||||
{
|
||||
Name = colour,
|
||||
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,
|
||||
Name = player.Name,
|
||||
PacMan = player.PacMan
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user