예제 #1
0
 public Game(GameController gameController, User firstUser)
 {
     // Initialization
     _publisher = new EventAggregator();
     GameController = gameController;
     _firstUser = firstUser ;
     Log.Verbose("Is First Player:" + _firstUser);
     _player = new Player(this, User.You);
     _opponent = new Player(this, User.Opponent);
     _idFactory = new IdFactory(_firstUser== User.You);
     _cardCache= new Dictionary<string, Card>();
 }
예제 #2
0
 private void Awake()
 {
     //System.Environment.SetEnvironmentVariable("MONO_REFLECTION_SERIALIZER", "yes"); <- добавить это если будет юзаться на айфоне для декодинга левела
     _saveScorePopup.Close += SaveScorePopupOnClose;
     _gameField = new Field();
     _gameFieldManager.Init(_gameField);
     _player = new Player();
     _player.Init(_gameField);
     _player.OnLifesCountChange += Player_OnLifesCountChange;
     _player.OnScoreChange += Player_OnScoreChange;
     _player.OnSnakeLengthChange += Player_OnSnakeLengthChange;
     _hudPanel.ChangeSnakeLength(_gameField.Snake.Count);
     _cameraController.Init(_gameFieldManager.SnakeHead);
     _audioController.PlayMusic();
     _gameFieldManager.Play();
 }