Ejemplo n.º 1
0
        public PlayFieldSpectatorViewModel()
        {
            InGameChatViewModel = new InGameChatViewModel();
            OpponentsViewModel  = new OpponentViewModel[OpponentCount];
            for (int i = 0; i < OpponentCount; i++)
            {
                OpponentsViewModel[i] = new OpponentViewModel();
            }

            ClientChanged += OnClientChanged;
        }
Ejemplo n.º 2
0
        public PlayFieldViewModel()
        {
            _achievementTimer = new Timer(100);
            _achievementTimer.Elapsed += (sender, args) =>
            {
                TimeSpan timeSpan = DateTime.Now - _lastAchievement;
                if (timeSpan.TotalSeconds > 5)
                {
                    AchievementOpacity -= 0.1;
                    if (AchievementOpacity <= 0)
                        _achievementTimer.Stop();
                }
            };

            GameInfoViewModel = new GameInfoViewModel();
            InGameChatViewModel = new InGameChatViewModel();
            PlayerViewModel = new PlayerViewModel();
            OpponentsViewModel = new OpponentViewModel[OpponentCount];
            for (int i = 0; i < OpponentCount; i++)
                OpponentsViewModel[i] = new OpponentViewModel();

            ClientChanged += OnClientChanged;
        }