public ScenarioRunner ReceivesAcceptDirectTradeEvent(string buyerName, ResourceClutch buyingResources, string sellerName, ResourceClutch sellingResources) { var gameEvent = new AcceptTradeEvent(this.GetPlayerId(buyerName), buyingResources, this.GetPlayerId(sellerName), sellingResources); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesAnswerDirectTradeOfferEvent(string buyingPlayerName, ResourceClutch wantedResources) { var gameEvent = new AnswerDirectTradeOfferEvent(this.GetPlayerId(buyingPlayerName), wantedResources); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesPlaceInfrastructureSetupEvent() { var gameEvent = new PlaceSetupInfrastructureEvent(); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesInitialBoardSetupEvent(GameBoardSetup gameBoardSetup) { var gameEvent = new InitialBoardSetupEvent(gameBoardSetup); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesGameErrorEvent(ErrorCodes errorCode, string errorMessage) { var gameEvent = new GameErrorEvent(this.GetPlayerId(this.currentPlayerAgent.Name), (int)errorCode, errorMessage); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesGameJoinedEvent() { var gameEvent = new GameJoinedEvent(this.GetPlayerId(this.currentPlayerAgent.Name)); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesConfirmGameStartEvent() { var gameEvent = new ConfirmGameStartEvent(); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesPlayerOrderEvent(string[] playerNames) { var playerIds = this.playerAgents.Select(playerAgent => playerAgent.Id).ToArray(); var gameEvent = new PlayerOrderEvent(playerIds); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesPlayerSetupEvent() { var playerIdsByName = this.playerAgents.ToDictionary(playerAgent => playerAgent.Name, playerAgent => playerAgent.Id); var playerNames = this.playerAgents.Select(playerAgent => playerAgent.Name).ToArray(); var gameEvent = new PlayerSetupEvent(playerNames, playerIdsByName); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesResourceCollectedEvent(Dictionary <string, ResourceCollection[]> resourcesCollectedByPlayerName) { var resourcesCollectedByPlayerId = new Dictionary <Guid, ResourceCollection[]>(); foreach (var kv in resourcesCollectedByPlayerName) { resourcesCollectedByPlayerId.Add(this.GetPlayerId(kv.Key), kv.Value); } var gameEvent = new ResourcesCollectedEvent(resourcesCollectedByPlayerId); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }
public ScenarioRunner ReceivesMonopolyCardPlayedEvent(Dictionary <string, ResourceClutch> resourcesByPlayerName, string playerName = null) { var playerId = playerName != null ? this.playerAgentsByName[playerName].Id : this.currentPlayerAgent.Id; var resourceTransactionList = new ResourceTransactionList(); if (resourcesByPlayerName != null && resourcesByPlayerName.Count > 0) { foreach (var kv in resourcesByPlayerName) { resourceTransactionList.Add(new ResourceTransaction(playerId, this.playerAgentsByName[kv.Key].Id, kv.Value)); } } var gameEvent = new PlayMonopolyCardEvent(playerId, resourceTransactionList); var eventInstruction = new EventInstruction(gameEvent); this.currentPlayerAgent.AddInstruction(eventInstruction); return(this); }