private void NodeChosen(Node node, GameInfo gameInfo, IGameState waitState) { gameInfo.Fsm.Remove(waitState); gameInfo.ClearTargets(); gameInfo.PanCameraToObject(gameInfo.CurrentPlayer); var currentPlayer = gameInfo.CurrentPlayer; currentPlayer.NextNode = node; // Give the player a passport for the island they are going to arrive at var assetResponse = currentPlayer.Accept(new PassportStamp(((Travel)node.BindedLogic.PureLogic).IslandType)); // Give the player a car modification if required currentPlayer.SetTransport(TransportType); if (assetResponse == AssetResponse.CollectedAllPassportStamps) { if (gameInfo.GameRuleType == GameRuleType.Passport) { gameInfo.Fsm.LazyPush(StateFactory.GetState(GameStates.GameStates.EndGame)); } } gameInfo.CreateMessage(String.Format("You have been given a {0} passport token!", IslandType)); gameInfo.Fsm.Push(StateFactory.GetState(GameStates.GameStates.VisuallyMovePlayer)); }
private void PathChosen(Node selectedNode, GameInfo gameInfo, IGameState waitState) { gameInfo.ClearTargets(); gameInfo.PanCameraToObject(gameInfo.CurrentPlayer); var currentPlayer = gameInfo.CurrentPlayer; currentPlayer.NextNode = selectedNode; gameInfo.Fsm.Remove(waitState); }
private void PathChosen(Node selectedNode, GameInfo gameInfo, IGameState waitState) { gameInfo.ClearTargets(); gameInfo.PanCameraToObject(gameInfo.CurrentPlayer); var currentPlayer = gameInfo.CurrentPlayer; currentPlayer.NextNode = selectedNode; gameInfo.Fsm.Remove(waitState); }
private static void CleanUp(Node node, Vector2 location, GameInfo gameInfo) { gameInfo.CreateMessage(String.Empty); gameInfo.ClearTargets(); foreach (var possibleNode in _possibleNodes) { possibleNode.RememberColorState(ColorState.None); possibleNode.SetColorState(ColorState.None); possibleNode.ListenMouseDown -= _cleanupCallback; possibleNode.ListenMouseDown -= _callback; } }
private static void CleanUp(Node node, Vector2 location, GameInfo gameInfo) { gameInfo.CreateMessage(String.Empty); gameInfo.ClearTargets(); foreach (var possibleNode in _possibleNodes) { possibleNode.RememberColorState(ColorState.None); possibleNode.SetColorState(ColorState.None); possibleNode.ListenMouseDown -= _cleanupCallback; possibleNode.ListenMouseDown -= _callback; } }
public IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo) { var spinnedNumber = gameInfo.Spinner.SpinnedNumber; gameInfo.ClearTargets(); gameInfo.CurrentPlayer.RollAmount = spinnedNumber; gameInfo.PanCameraToObject(gameInfo.CurrentPlayer); switch (spinnedNumber) { case 1: return new[] {StateFactory.GetState(GameStates.ChangeWorld)}; case 10: return gameInfo.GameRuleType == GameRuleType.Retirement ? new[] { StateFactory.GetState(GameStates.IncreaseAge) } : null; } return null; }
public IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo) { var spinnedNumber = gameInfo.Spinner.SpinnedNumber; gameInfo.ClearTargets(); gameInfo.CurrentPlayer.RollAmount = spinnedNumber; gameInfo.PanCameraToObject(gameInfo.CurrentPlayer); switch (spinnedNumber) { case 1: return(new[] { StateFactory.GetState(GameStates.ChangeWorld) }); case 10: return(gameInfo.GameRuleType == GameRuleType.Retirement ? new[] { StateFactory.GetState(GameStates.IncreaseAge) } : null); } return(null); }
private void PlayerClicked(Player clickedPlayer, Vector2 location, GameInfo gameInfo, IGameState waitState) { //Cash will be entered negative, so "minus-minus" for you, //"plus-minus for the player you sued" clickedPlayer.Cash += CashValue; gameInfo.CurrentPlayer.Cash -= CashValue; foreach (var player in gameInfo.PlayerList) { player.ListenMouseDown -= _clickPlayer; player.ListenMouseOver -= PlayerMouseIn; player.ListenMouseOut -= PlayerMouseOut; player.ResetColorState(); } gameInfo.ClearTargets(); //Alert will be appear to confirm you sued them var alert = new Alert(gameInfo.Manager, String.Format("You successfully sue {0}!", clickedPlayer.Name), String.Format("Sue {0}!", clickedPlayer.Name), icon: "Images/AlertIcons/Loan"); gameInfo.Manager.Add(alert); alert.Closed += (sender, args) => gameInfo.Fsm.Remove(waitState); }
private void PlayerClicked(Player clickedPlayer, Vector2 location, GameInfo gameInfo, IGameState waitState) { //Cash will be entered negative, so "minus-minus" for you, //"plus-minus for the player you sued" clickedPlayer.Cash += CashValue; gameInfo.CurrentPlayer.Cash -= CashValue; foreach (var player in gameInfo.PlayerList) { player.ListenMouseDown -= _clickPlayer; player.ListenMouseOver -= PlayerMouseIn; player.ListenMouseOut -= PlayerMouseOut; player.ResetColorState(); } gameInfo.ClearTargets(); //Alert will be appear to confirm you sued them var alert = new Alert(gameInfo.Manager, String.Format("You successfully sue {0}!", clickedPlayer.Name), String.Format("Sue {0}!", clickedPlayer.Name), icon : "Images/AlertIcons/Loan"); gameInfo.Manager.Add(alert); alert.Closed += (sender, args) => gameInfo.Fsm.Remove(waitState); }
private void NodeChosen(Node node, GameInfo gameInfo, IGameState waitState) { gameInfo.Fsm.Remove(waitState); gameInfo.ClearTargets(); gameInfo.PanCameraToObject(gameInfo.CurrentPlayer); var currentPlayer = gameInfo.CurrentPlayer; currentPlayer.NextNode = node; // Give the player a passport for the island they are going to arrive at var assetResponse = currentPlayer.Accept(new PassportStamp(((Travel)node.BindedLogic.PureLogic).IslandType)); // Give the player a car modification if required currentPlayer.SetTransport(TransportType); if (assetResponse == AssetResponse.CollectedAllPassportStamps) { if(gameInfo.GameRuleType == GameRuleType.Passport) { gameInfo.Fsm.LazyPush(StateFactory.GetState(GameStates.GameStates.EndGame)); } } gameInfo.CreateMessage(String.Format("You have been given a {0} passport token!", IslandType)); gameInfo.Fsm.Push(StateFactory.GetState(GameStates.GameStates.VisuallyMovePlayer)); }