private void GameOver(GameOverCondition failCondition) { if (OnGameOver != null) { OnGameOver(failCondition); } }
/*public AutomatedCar(int x, int y, string filename) * : base(x, y, filename, true, new RotationMatrix(1.0, 0.0, 0.0, 1.0))*/ public AutomatedCar(int x, int y, string filename, int width, int height, List <List <Point> > polylist) : base(x, y, filename, width, height, -width / 2, -height / 2, new Matrix(1, 0, 0, 1, 1, 1), polylist) { this.virtualFunctionBus = new VirtualFunctionBus(); this.AEB = new AEB(this.virtualFunctionBus); this.humanMachineInterface = new HumanMachineInterface(this.virtualFunctionBus); this.accController = new AccController(this.virtualFunctionBus); this.powerTrain = new PowerTrain(this.virtualFunctionBus, x, y); this.gameOver = new GameOverCondition(this.virtualFunctionBus); this.Brush = new SolidColorBrush(Color.Parse("red")); this.Ultrasounds = new Ultrasound[] { new Ultrasound(this.virtualFunctionBus, 110, 30, 0), new Ultrasound(this.virtualFunctionBus, 105, 45, 90), new Ultrasound(this.virtualFunctionBus, 110, -30, 0), new Ultrasound(this.virtualFunctionBus, 105, -45, -90), new Ultrasound(this.virtualFunctionBus, -120, 25, 180), new Ultrasound(this.virtualFunctionBus, -105, 45, 90), new Ultrasound(this.virtualFunctionBus, -120, -25, 180), new Ultrasound(this.virtualFunctionBus, -105, -45, -90), }; this.Radar = new Radar(this.virtualFunctionBus); this.ultraSoundVisible = false; this.radarVisible = false; this.cameraVisible = false; this.polygonVisible = false; }
// Constructor to initialize a new game state using the specified // GameBoard. public GameState(GameBoard aBoard) { this.board = aBoard; this.gameIsOver = false; this.totalMoveCount = 0; this.gameOverCondition = GameOverCondition.None; this.winningPlayerNumber = GamePlayer.None; this.history = new Stack<string>(); }
// Constructor instantiates a GameMessage of type GameOver and sets the // GameOverCondition with the data contained in the specified message string. public GameOver(string msg) { if (!GameMessage.IsGameOver(msg)) throw new Exception("This is not a GameOver message."); // Remove all whitespace characters from the message string. string msgString = RemoveAllWhiteSpace(msg); this.data = msgString; string conditionString = GameMessage.GetMessageData(msgString); this.condition = (GameOverCondition)Enum.Parse(typeof(GameOverCondition), conditionString); }
private void OnWrongAnswer(GameOverCondition condition) { mIsGameOver = true; _Tint.SetActive(true); if (condition == GameOverCondition.WrongAnswer) { _Result.text = "Game over. Wrong answer! Tap to restart."; } else { _Result.text = "Time UP!"; } }
// Use this for initialization void Awake() { _overCondition = (GameOverCondition)FindObjectOfType(typeof(GameOverCondition)); type = _overCondition.overType(); string title = ""; if (type == GameOverCondition.OverType.MOVE) { title = "Move"; } else if (type == GameOverCondition.OverType.TIME) { title = "Time"; } MakeText(title, new Vector2(0, 0.2f), 40, Color.black); _text = MakeText("0", new Vector2(0, -0.2f), 30, Color.black); }
public void EndGame(GamePlayer winner, GameOverCondition condition) { this.logic.GetGameState().SetGameOver(winner, condition); }
// Constructor instantiates a GameMessage of type GameOver with // the specified GameOverCondition. public GameOver(GameOverCondition aCondition) { this.condition = aCondition; this.data = string.Format("{0}{{{1}}}", typeof(GameMessage.GameOver).Name.ToString(), this.condition.ToString()); }
private void EndGame(GameOverCondition condition) { if (this.stateCode != ClientStateCode.GameIsOver) { ClientStateCode lastStateCode = this.stateCode; this.stateCode = ClientStateCode.GameIsOver; if (lastStateCode > 0) { this.Display("Disconnected."); this.client.Disconnect(); if (lastStateCode == ClientStateCode.GameIsInProgress) lock (this.locker) { this.gameClientLogic.EndGame(this.playerNumber, condition); this.gameStateQueue.Enqueue(this.gameClientLogic.GetGameState()); } } ChangeConnectButtonText("Connect"); } pictureBox1.Invalidate(); }
public void NotifyFailure(GameOverCondition cond) { NotifyGameOver(false, cond.GetProgressInfo()); }
public void NotifySuccess(GameOverCondition cond) { NotifyGameOver(true, cond.GetProgressInfo()); }
public void SetGameOver(GamePlayer winner, GameOverCondition condition) { this.winningPlayerNumber = winner; this.gameOverCondition = condition; this.gameIsOver = true; }
public GameOverEventArgs(GameOverCondition condition) { Condition = condition; }