Beispiel #1
0
Datei: Job.cs Projekt: zhxie/Ikas
        public int GetSalmoniodKill(Salmoniod.Key id)
        {
            int count = 0;

            count = count + MyPlayer.SalmoniodKills.Find(p => p.Salmoniod == id).Count;
            foreach (JobPlayer player in OtherPlayers)
            {
                count = count + player.SalmoniodKills.Find(p => p.Salmoniod == id).Count;
            }
            return(count);
        }
Beispiel #2
0
        public void SetSalmoniod(Salmoniod.Key salmoniod, JobPlayer player = null, Job job = null)
        {
            Salmoniod = salmoniod;
            Player    = player;
            Job       = job;
            ((Storyboard)FindResource("fade_out")).Begin(gridMain);
            Storyboard sb = (Storyboard)FindResource("resize_width");

            (sb.Children[0] as DoubleAnimation).To = 0;
            sb.Begin(bdRatio);
            ((Storyboard)FindResource("fade_out")).Begin(bdRatio);
            if (Salmoniod != Class.Salmoniod.Key.salmoniod_unknown && Player != null && Job != null)
            {
                lbName.SetResourceReference(ContentProperty, Salmoniod.ToString());
                int kill     = Player.SalmoniodKills.Find(p => p.Salmoniod == Salmoniod).Count;
                int jobKill  = Job.GetSalmoniodKill(Salmoniod);
                int jobCount = Job.SalmoniodAppearances.Find(p => p.Salmoniod == Salmoniod).Count;
                if (jobKill == jobCount && jobKill != 0)
                {
                    lbName.Foreground      = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + Design.NeonYellow));
                    lbKill.Foreground      = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + Design.NeonYellow));
                    lbKillShort.Foreground = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF" + Design.NeonYellow));
                }
                else
                {
                    lbName.Foreground      = new SolidColorBrush(Colors.White);
                    lbKill.Foreground      = new SolidColorBrush(Colors.White);
                    lbKillShort.Foreground = new SolidColorBrush(Colors.White);
                }
                lbKill.Content      = string.Format(Translate("x{0}/{1}/{2}", true), kill, jobKill, jobCount);
                lbKillShort.Content = string.Format(Translate("x{0}", true), kill);
                ((Storyboard)FindResource("fade_in")).Begin(gridMain);
                if (jobKill != 0)
                {
                    double to = (kill * 0.9 / jobKill + 0.1) * bdMain.Width;
                    (sb.Children[0] as DoubleAnimation).To = to;
                    sb.Begin(bdRatio);
                    ((Storyboard)FindResource("fade_in")).Begin(bdRatio);
                }
                else
                {
                    double to = 0.1 * bdMain.Width;
                    (sb.Children[0] as DoubleAnimation).To = to;
                    sb.Begin(bdRatio);
                    ((Storyboard)FindResource("fade_in")).Begin(bdRatio);
                }
            }
        }
Beispiel #3
0
        public void SetImage(Salmoniod.Key id)
        {
            Salmoniod = id;
            switch (Salmoniod)
            {
            case Class.Salmoniod.Key.goldie:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-goldie.png"));
                break;

            case Class.Salmoniod.Key.steelhead:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-steelhead.png"));
                break;

            case Class.Salmoniod.Key.flyfish:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-flyfish.png"));
                break;

            case Class.Salmoniod.Key.scrapper:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-scrapper.png"));
                break;

            case Class.Salmoniod.Key.steel_eel:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-steel-eel.png"));
                break;

            case Class.Salmoniod.Key.stinger:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-stinger.png"));
                break;

            case Class.Salmoniod.Key.maws:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-maws.png"));
                break;

            case Class.Salmoniod.Key.griller2:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-griller.png"));
                break;

            case Class.Salmoniod.Key.drizzler:
                imgMain.Source = new BitmapImage(new Uri("pack://application:,,,/assets/img/salmoniods-drizzler.png"));
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Beispiel #4
0
 public SalmoniodCount(Salmoniod.Key salmoniod, int count)
 {
     Salmoniod = salmoniod;
     Count     = count;
 }