Continous Integration in der Praxis Gruppenarbeit
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

  1. using System;
  2. namespace MiniGames.Shared.Models
  3. {
  4. public class TicTacToeModel
  5. {
  6. public SpielerModel[] Spieler { get; set; }
  7. public int AktiverSpielerIndex { get; set; } = 0;
  8. public int GewinnerIndex { get; set; } = -1;
  9. public TicTacToeBrett Brett { get; set; }
  10. public SpielerModel GewinnerSpieler
  11. {
  12. get { return (GewinnerIndex >= 0) ? Spieler[GewinnerIndex] : null; }
  13. set { GewinnerIndex = Array.IndexOf(Spieler, value); }
  14. }
  15. public bool Fertig()
  16. {
  17. return GewinnerIndex >= 0 || Brett.Voll();
  18. }
  19. }
  20. }