Esempio n. 1
0
 public bool Contains(Player item)
 {
     return _players.Contains(item);
 }
        void SetFirstItem(Player player, bool isEndGame)
        {
            try
            {
                var leadString = FindViewById<TextView>(Resource.Id.leadText);
                var imageView = FindViewById<ImageView>(Resource.Id.playerImage);
                var textScore = FindViewById<TextView>(Resource.Id.scoreText);
                var playerName = FindViewById<TextView>(Resource.Id.playerName);
                var playerScore = FindViewById<TextView>(Resource.Id.playerScore);

                leadString.SetTypeface(Rep.FontManager.Get(Font.BoldCondensed), TypefaceStyle.Normal);
                textScore.SetTypeface(Rep.FontManager.Get(Font.BoldCondensed), TypefaceStyle.Normal);
                playerName.SetTypeface(Rep.FontManager.Get(Font.BoldCondensed), TypefaceStyle.Normal);
                playerScore.SetTypeface(Rep.FontManager.Get(Font.BoldCondensed), TypefaceStyle.Normal);

                imageView.SetImageBitmap(player.Image);
                playerName.Text = player.Name.ToUpper();
                playerScore.Text = player.Score.ToString();
                leadString.Text = Resources.GetString(isEndGame
                    ? Resource.String.WinnerString
                    : Resource.String.LeadString);
            }
            catch (Exception exception)
            {
                GaService.TrackAppException(this.Class, "SetFirstItem", exception, false);
            }
           

        }
Esempio n. 3
0
 public void Add(Player item, bool raiseOnCollectionChanged)
 {
     _players.Add(item);
     if (raiseOnCollectionChanged) OnCollectionChanged();
     item.ScoreChanged += ItemOnScoreChanged;
 }
Esempio n. 4
0
 public int GetPosition(Player player)
 {
     return _players.All(p => p.Score == 0) ? 0 : _players.Count(p => p.Score > player.Score) + 1;
 }
Esempio n. 5
0
        public bool Remove(Player player)
        {
            var removedPlayer = _players.Remove(player);
            if (removedPlayer)
            {
                player.ScoreChanged -= ItemOnScoreChanged;
                OnCollectionChanged();
                OnItemRemoved();
            }

            return removedPlayer;
        }
Esempio n. 6
0
 public void Add(Player item)
 {
     this.Add(item, true);
 }
Esempio n. 7
0
 public void Insert(int index, Player item)
 {
     _players.Insert(index, item);
     OnCollectionChanged();
 }
Esempio n. 8
0
 public int IndexOf(Player player)
 {
     return _players.IndexOf(player);
 }
Esempio n. 9
0
 public void CopyTo(Player[] array, int arrayIndex)
 {
     _players.CopyTo(array, arrayIndex);
     OnCollectionChanged();
 }
Esempio n. 10
0
        private void ShowDialogTask(Player player, int taskScore)
        {
            try
            {
                var taskStrings = TaskDialogBuilder.GetTask(_taskDialog, taskScore, player.GetModel());

                var color = _taskDialog == TaskDialog.Make ? _greenColor : _redColor;
                _statusTitleText.SetTextColor(color);
                _statusDescriptionText.SetTextColor(color);

                _statusTitleText.Text = taskStrings.GetStatusTitle();
                _statusDescriptionText.Text = taskStrings.GetStartDesc();
                _changeCountScoreText.Text = taskStrings.GetChangedScore();
                _endDescriptionText.Text = taskStrings.GetEndDesc();
                _currentScoreText.Text = taskStrings.GetCurentScore();

                ShowTaskProgress(true);
            }
            catch (Exception exception)
            {
                GaService.TrackAppException(this.Class, "ShowDialogTask", exception, true);
            }

        }
        private void Initialize()
        {
            try
            {
                _chooseFromContactsButton = FindViewById<Button>(Resource.Id.chooseFromContButton);
                _confirmButton = FindViewById<Button>(Resource.Id.confirmButton);
                _cancelButton = FindViewById<Button>(Resource.Id.cancelButton);
                _editText = FindViewById<EditText>(Resource.Id.playerName);
                _playerImageButton = FindViewById<ImageButton>(Resource.Id.playerImage);

                SetFont(_cancelButton);
                SetFont(_confirmButton);
                SetFont(_chooseFromContactsButton);
                SetFontItalic(_editText);



                _confirmButton.Background.Alpha = 255;
                _confirmButton.SetTextColor(Resources.GetColor(Resource.Color.white));
                _cancelButton.Background.Alpha = 255;
                _cancelButton.SetTextColor(Resources.GetColor(Resource.Color.white));

                _confirmButton.Enabled = true; SetConfirmButtonEnabled(false);


                _player = new Player();
                //To set _playImage to default
                PlayerImagePath = null;
            }
            catch (Exception exception)
            {
                GaService.TrackAppException(this.Class, "Initialize", exception, false);
            }
        }