KoogleV4/GameHandler/ThrowHandler.cs

44 lines
1.3 KiB
C#

using GameModel;
namespace GameHandler
{
public class ThrowHandler
{
public BoardState Init(ThrowMode throwMode)
{
var picture = new PinPicture();
return new BoardState(throwMode,picture);
}
/// <summary>
/// Bild stellen
/// </summary>
/// <param name="boardstate"></param>
/// <param name="throwMode"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public BoardState SetBoardstatePicture(PinPicture boardstate, ThrowMode throwMode)
{
throw new NotImplementedException();
}
/// <summary>
/// neu autstellen
/// </summary>
/// <param name="currentState"></param>
/// <param name="pinThrow"></param>
/// <returns></returns>
public BoardState Update(BoardState currentState, PinThrow pinThrow)
{
if (currentState.ThrowMode == ThrowMode.Reposition)
{
return currentState with { PinPicture = new PinPicture() };
}
else
{
return currentState with { PinPicture = currentState.PinPicture + pinThrow };
}
}
}
}