|
|
|
@ -5,6 +5,7 @@ using System.Collections.ObjectModel;
|
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
using System.Runtime.Serialization;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Threading.Tasks.Dataflow;
|
|
|
|
@ -19,6 +20,7 @@ namespace Models.Game
|
|
|
|
|
/// The Game class represents a game session in the application.
|
|
|
|
|
/// It contains all the necessary properties and methods to manage a game, including the game loop, dice rolling, and use of the game rules.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataContract]
|
|
|
|
|
public class Game : INotifyPropertyChanged
|
|
|
|
|
{
|
|
|
|
|
/* Persistence */
|
|
|
|
@ -74,19 +76,24 @@ namespace Models.Game
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private bool _isRunning;
|
|
|
|
|
[DataMember]
|
|
|
|
|
public bool IsRunning
|
|
|
|
|
{
|
|
|
|
|
get => _isRunning;
|
|
|
|
|
private set => _isRunning = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Player CurrentPlayer { get; private set; }
|
|
|
|
|
[DataMember]
|
|
|
|
|
public Player? CurrentPlayer { get; private set; }
|
|
|
|
|
|
|
|
|
|
public Map UsedMap { get; private set; }
|
|
|
|
|
[DataMember]
|
|
|
|
|
public Map? UsedMap { get; private set; }
|
|
|
|
|
|
|
|
|
|
public Dice Dice1 { get; private set;}
|
|
|
|
|
|
|
|
|
|
public Dice Dice2 { get; private set; }
|
|
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
|
public int Turn { get; private set; }
|
|
|
|
|
|
|
|
|
|
public Rules.Rules GameRules { get; }
|
|
|
|
|