You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
630 B
22 lines
630 B
using System;
|
|
|
|
namespace MiniGames.Shared.Models
|
|
{
|
|
public class TicTacToeModel
|
|
{
|
|
public SpielerModel[] Spieler { get; set; }
|
|
public int AktiverSpielerIndex { get; set; } = 0;
|
|
public int GewinnerIndex { get; set; } = -1;
|
|
public TicTacToeBrett Brett { get; set; }
|
|
public SpielerModel GewinnerSpieler
|
|
{
|
|
get { return (GewinnerIndex >= 0) ? Spieler[GewinnerIndex] : null; }
|
|
set { GewinnerIndex = Array.IndexOf(Spieler, value); }
|
|
}
|
|
|
|
public bool Fertig()
|
|
{
|
|
return GewinnerIndex >= 0 || Brett.Voll();
|
|
}
|
|
}
|
|
}
|