public FacadeController(AuthLogic authLogic, TurnLogic turnLogic) { _authLogic = authLogic; _turnLogic = turnLogic; drawcardcontroller = new DrawCardController(); strategy = new Strategy(); }
public void GetPlayerTurn_GivenNewGame_ShouldReturnBlue() { // arrange var lobby = new Domain.Entities.Lobby(); // action var playerTurn = new TurnLogic().GetPlayerTurn(lobby); // assert playerTurn.ShouldBe(Domain.Enumerations.Colour.Blue); }
public void GetPlayerTurn_AfterOneRound_ShouldReturnRed() { // arrange var lobby = new Domain.Entities.Lobby(); lobby.Rounds = new List <Round> { new Round() }; // action var playerTurn = new TurnLogic().GetPlayerTurn(lobby); // assert playerTurn.ShouldBe(Domain.Enumerations.Colour.Red); }
void Awake() { //Check if instance already exists if (instance == null) { //if not, set instance to this instance = this; } //If instance already exists and it's not this: else if (instance != this) { //Then destroy this. This enforces our singleton pattern, meaning there can only ever be one instance of a GameManager. Destroy(gameObject); } }
//if have both player declaration calculate turn show them and send results to client private void CheckAndCalculateTurn() { if (Player1 == null || Player2 == null) { return; } Gm.ShowMessage("Calculating turn"); var turnResults = TurnLogic.ResolveTurn(Player1, Player2, Gm.Map); Player1 = null; Player2 = null; SendData(1, Serializer.Serialize(Gm.Map)); SendData(0, Serializer.Serialize(turnResults)); Gm.ShowResultsFromGc(turnResults); }
public void ForceWin(SeatType id) { var player = TurnLogic.GetPlayer(id); GameMechanics.FinishGame.Execute(player); }
private void InitializeTurnBasedStructures(GameArgs args) { TurnLogic = new TurnLogic(Players); BattleFsm = new BattleFsm(args, this); }
public void ForceWin(PlayerSeat seat) { var player = TurnLogic.GetPlayer(seat); ProcessFinishGame.Execute(player); }