Ejemplo n.º 1
0
        public async Task <int> FillMVPPhotos(string csv)
        {
            MVP hz = new MVP();

            using (var reader = new CsvHelper.CsvReader(new StringReader(csv)))
            {
                var mvps = reader.EnumerateRecords <MVP>(hz);
                return(await FillMVPPhotos(mvps));
            }
        }
Ejemplo n.º 2
0
        public MultiSelectListViewViewModel()
        {
            MVPs = new MultiSelectObservableCollection <MVP>();

            MVP mvp = new MVP
            {
                Nome = "Bertuzzi"
            };

            MVPs.Add(mvp);

            mvp = new MVP
            {
                Nome = "Renato (BOT) Groff"
            };

            MVPs.Add(mvp);

            mvp = new MVP
            {
                Nome = "Thiago Adriano"
            };

            MVPs.Add(mvp);

            mvp = new MVP
            {
                Nome = "Ericson Fonseca"
            };

            MVPs.Add(mvp);

            mvp = new MVP
            {
                Nome = "Milton Camara"
            };

            MVPs.Add(mvp);
        }
Ejemplo n.º 3
0
        public IEnumerable <PlayedMatch> GetPlayedMatches()
        {
            List <TeamSeason> teams     = GetListOfTeamSeason().Take(9).ToList <TeamSeason>();
            LeagueFilterData  ourLeague = GetPureLeagues().ToList <LeagueFilterData>()[0];
            SeasonFilterData  ourSeason = GetSeasons().GetSeasons().ToList <SeasonFilterData>()[0];
            GroupFilterData   ourGroup  = GetGroups().ToList <GroupFilterData>()[0];
            List <Stage>      stages    = GetStages().ToList <Stage>();
            Player            Mrozo     = GetPlayers().ToList <Player>()[0];
            Player            Kurek     = GetPlayers().ToList <Player>()[1];
            Player            Kaczor    = GetPlayers().ToList <Player>()[2];
            Player            Obol      = GetPlayers().ToList <Player>()[5];

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[1],
                HomePoints = 44,
                AwayPoints = 75,
                DateTime = new DateTime(2019, 3, 3, 17, 0, 0),
                MatchDescription = "Najgorszy mecz w lidze przegrany bardzo wyraźnie.",
                MVP = new MVP()
                {
                    Player = Kurek, PerformanceDesciption = "9 zbiórek, 10 punktów"
                },
                Stage = stages[0]
            });

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[2],
                HomePoints = 60,
                AwayPoints = 68,
                DateTime = new DateTime(2019, 3, 24, 15, 45, 0),
                MatchDescription = "Wygrywaliśmy mecz przez 3.5 kwarty z najlepszą drużyną ligi.",
                MVP = new MVP()
                {
                    Player = Mrozo, PerformanceDesciption = "26 punktów, 5/9 trójek"
                },
                Stage = stages[1]
            });

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[3],
                HomePoints = 70,
                AwayPoints = 26,
                DateTime = new DateTime(2019, 4, 28, 18, 15, 0),
                MatchDescription = "Totalnie zmiażdżyliśmy przeciwników.",
                MVP = new MVP()
                {
                    Player = Kaczor, PerformanceDesciption = "Double-duble, 17 punktów, 10 zbiórek"
                },
                Stage = stages[2]
            });

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[4],
                HomePoints = 43,
                AwayPoints = 50,
                DateTime = new DateTime(2019, 5, 12, 17, 0, 0),
                MatchDescription = "Przeciwnicy ograli nas pressingiem w drugiej połowie.",
                MVP = new MVP()
                {
                    Player = Mrozo, PerformanceDesciption = "16 punktów, 9 zbiórek"
                },
                Stage = stages[3]
            });

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[5],
                HomePoints = 54,
                AwayPoints = 59,
                DateTime = new DateTime(2019, 5, 26, 15, 45, 0),
                MatchDescription = "Ustawiiśmy się 3 zawodnikami na dole i przeciwnicy rzucili nam 10 trójek.",
                MVP = new MVP()
                {
                    Player = Obol, PerformanceDesciption = "6 punktów (3/5), 12 zbiórek"
                },
                Stage = stages[4]
            });

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[6],
                HomePoints = 53,
                AwayPoints = 54,
                DateTime = new DateTime(2019, 6, 2, 14, 25, 0),
                MatchDescription = "Mecz przegrany 1 punktem w dogrywce, Kudłaty i Mrozo zepsuli buzzer-beatery. 50 sekund przed końcem meczu wygrywaliśmy 4 punktami. Przeciwnicy grali w piatkę.",
                MVP = new MVP()
                {
                    Player = Kurek, PerformanceDesciption = "5 punktów (2/3), 18 zbiórek, 2 asysty, 2 bloki"
                },
                Stage = stages[5]
            });

            yield return(new PlayedMatch()
            {
                Home = teams[0],
                Away = teams[7],
                HomePoints = 51,
                AwayPoints = 69,
                DateTime = new DateTime(2019, 6, 15, 10, 00, 0),
                MatchDescription = "Nasi przeciwnicy byli po prostu lepsi demolując nas w drugiej kwarcie 22-4.",
                MVP = new MVP()
                {
                    Player = Kurek, PerformanceDesciption = "Double-double (10 punktów (63%), 12 zbiórek)"
                },
                Stage = stages[6]
            });

            foreach (TeamSeason home in GetListOfTeamSeason())
            {
                TeamFilterData HomeRandom = home.Team;

                List <TeamSeason> AwayRandoms = GetListOfTeamSeason().Where(x => x.GroupSeason.Id == home.GroupSeason.Id && x.Id != home.Id).Take(5).ToList <TeamSeason>();
                foreach (TeamSeason away in AwayRandoms)
                {
                    TeamFilterData AwayRandom  = away.Team;
                    int            randomYear  = new Random().Next(2018, 2019 + 1);
                    int            randomMonth = new Random().Next(1, 12 + 1);
                    int            randomDay   = new Random().Next(1, 30 + 1);
                    int            randomHour  = new Random().Next(10, 18 + 1);
                    DateTime       randomDate  = new DateTime(randomYear, randomMonth, randomDay, randomHour, 0, 0);

                    int   stageRandomIndex = new Random().Next(0, GetStages().Take(6).ToList <IStage>().Count);
                    Stage StageRandom      = GetStages().ToList <Stage>()[stageRandomIndex];

                    int mvpRandomIndex = new Random().Next(0, GetPlayers().ToList <Player>().Count);
                    MVP PlayerRandom   = new MVP()
                    {
                        Player = GetPlayers().ToList <Player>()[mvpRandomIndex], PerformanceDesciption = "Opis występu... opis występu... "
                    };

                    int randomHomePoints = new Random().Next(50, 151);
                    int randomAwayPoints = 0;
                    do
                    {
                        randomAwayPoints = new Random().Next(50, 151);
                    } while (randomAwayPoints == randomHomePoints);

                    yield return(new PlayedMatch()
                    {
                        Home = home,
                        Away = away,
                        HomePoints = randomHomePoints,
                        AwayPoints = randomAwayPoints,
                        DateTime = randomDate,
                        MatchDescription = "Tego nie będziemy randomizować...",
                        Stage = StageRandom,
                        MVP = PlayerRandom,
                    });
                }
            }
        }
Ejemplo n.º 4
0
        public byte Reward(byte OrbId, Keys victim)
        {
            byte temp;

            lock (MVP.RecordsLock) {
                lock (lock_reward) {
                    if (killed.Contains(victim) || HEADS[victim].Died)
                    {
                        return(0);
                    }
                    else if (!KingOfTheHill)
                    {
                        killed.Add(victim);
                    }

                    if (ChaosMode && Leader == victim)
                    {
                        Leader = this.KeyCode;
                    }

                    OnReward?.Invoke();
                    temp = this.Points;
                    Kills++;
                    this.Points += KingOfTheHill? (byte)1 : Kills;
                    if (HEADS[victim].isBounty)
                    {
                        this.Points++;
                    }
                    if (HEADS[victim].isDoubleBounty)
                    {
                        this.Points++;
                    }
                    this.Points += Orb.All[OrbId].KillStreak++;
                    key.Add(this.Points - temp);
                    key.points = Points;

                    if (Orb.All[OrbId].KillStreak > 1)
                    {
                        if (KingOfTheHill)
                        {
                            MVP.Flash("Collateral!");
                        }
                        else
                        {
                            MVP.Add(MVPTypes.COLLATERAL, DisplayKey, Orb.All[OrbId].KillStreak.ToString());
                        }
                    }

                    if (Died)
                    {
                        if (KingOfTheHill)
                        {
                            MVP.Flash("GhostKill!");
                        }
                        else
                        {
                            MVP.Add(MVPTypes.GHOSTKILL, DisplayKey);
                        }
                    }
                }
            }

            if (KingOfTheHill)
            {
                Map.Sort();
                IKey.UpdateAll();
                bool leader = true;
                int  second = 0;

                lock (ActiveLock)
                    foreach (Head head in HEADS.Values)
                    {
                        if (head.KeyCode == KeyCode)
                        {
                            continue;
                        }
                        if (this.Points < head.Points)
                        {
                            leader = false;
                        }
                        if (second < head.Points)
                        {
                            second = head.Points;
                        }
                    }

                if (leader)
                {
                    Leader = this.KeyCode;
                }

                if (this.Points >= Map.MaxPoints && Points - second > 1 && Map.phase != Phases.ENDGAME)
                {
                    MVP.Show(MVP.WinMessage(this.DisplayKey));
                    new Thread(Map.EndGame).Start();
                }
                else if (Kills >= 5 && !isBounty)
                {
                    MVP.Flash($"{DisplayKey} killstreak");
                    this.isBounty = true;
                }
                else if (this.Points >= Map.MaxPoints - 1 && !isBounty)
                {
                    this.isBounty = true;
                    MVP.Flash("Matchpoint!");
                }

                else if (isBounty && Kills >= 5 && this.Points >= Map.MaxPoints - 1 && !isDoubleBounty)
                {
                    MVP.Flash("Double Bounty!");
                    this.isDoubleBounty = true;
                }
            }
            return((byte)(Points - temp));
        }
Ejemplo n.º 5
0
        public void Die()
        {
            lock (lock_die) {
                if (Died)
                {
                    return;
                }
                this.act = Activities.DEAD;
            }

            OnUpdate -= e_update;
            if (AnimationsEnabled)
            {
                window.DrawHead -= draw_event;
            }

            if (Tick < 60 + Map.StartRoundTime)
            {
                MVP.Add(MVPTypes.EARLY_KILL, DisplayKey);
            }

            lock (ActiveLock) {
                ActiveKeys.Remove(this.KeyCode);
                if (KingOfTheHill)
                {
                    InactiveKeys.Add(this.KeyCode);
                }
                else
                {
                    InactiveKeys.Insert(0, this.KeyCode);
                }
            }
            key.Die();
            tail.Die();
            z            = 0;
            DashHideText = false;

            if (isBounty)
            {
                new Animation(pos, 30, HeadR - 1, HeadR - 5, 5, 0, Color.Red, Color.Red, AnimationTypes.CUBED);
            }

            isBounty       = false;
            isDoubleBounty = false;

            if (AnimationsEnabled && ActiveKeys.Count <= 12 && !(Map is BotArena))
            {
                _ = new Animation(pos, 80, 0, W, HeadR, (float)PHI * HeadR, Color.FromArgb(150, this.color), 0);
            }
            if (AnimationsEnabled)
            {
                _ = new Animation(pos, 12, 0, 0, HeadR, HeadR, this.color, 32, AnimationTypes.CUBED);
            }
            else
            {
                window.writeln(DisplayKey + " died: " + Points + " pts");
            }



            if (KingOfTheHill)
            {
                IKey.UpdateAll();
                new Thread(() => {
                    int tick = Tick;
                    SpinWait.SpinUntil(() => Tick >= tick + 120 || Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning);
                    if (Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning)
                    {
                        return;
                    }
                    new Coin(IPoint.Center + 3 * IVector.Random(), "3", this.color);

                    SpinWait.SpinUntil(() => Tick >= tick + 180 || Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning);
                    if (Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning)
                    {
                        return;
                    }
                    new Coin(IPoint.Center + 3 * IVector.Random(), "2", this.color);

                    SpinWait.SpinUntil(() => Tick >= tick + 240 || Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning);
                    if (Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning)
                    {
                        return;
                    }
                    new Coin(IPoint.Center + 3 * IVector.Random(), "1", this.color);

                    SpinWait.SpinUntil(() => Tick >= tick + 300 || Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning);
                    if (Map.phase != Phases.NONE || state == States.NEWGAME || !ApplicationRunning)
                    {
                        return;
                    }
                    lock (updatinglocker) {
                        this.clear();
                        this.Revive();
                        this.act = Activities.DEFAULT;
                        lock (ActiveLock) {
                            ActiveKeys.Add(KeyCode);
                            InactiveKeys.Remove(KeyCode);
                        }
                        this.INVINCIBLE = true;
                    }
                    SpinWait.SpinUntil(() => (Tick >= tick + 360 && !is_about_to_die()) || !ApplicationRunning);
                    this.INVINCIBLE = false;

                    SpinWait.SpinUntil(() => (Tick >= tick + 372 || Died) || !ApplicationRunning);
                    if (Tick <= tick + 372 && Died)
                    {
                        MVP.Flash("Spawnkill!");
                    }
                }).Start();
            }
            else
            {
                Map.Sort();
                IKey.UpdateAll();
                if (ActiveKeys.Count == 1 && Map.phase != Phases.ENDROUND)
                {
                    new Thread(Map.EndRound).Start();
                }
            }

            if (OnDie != null)
            {
                Parallel.Invoke(OnDie);
            }
        }