Exemplo n.º 1
0
        public virtual void Advance()
        {
            if (!IsCollaborating)
            {
                Log.Add("");
                Log.Add(CurrentSeason.ToString() + " " + _seasonList.Count() / 4);
                IAction activity = DecideSeasonalActivity();
                _seasonList.Add(activity);
                activity.Act(this);
                if (SeasonalAge >= 140)
                {
                    Age(LongevityRitual);
                }
                switch (CurrentSeason)
                {
                case Season.Spring:
                    CurrentSeason = Season.Summer;
                    break;

                case Season.Summer:
                    CurrentSeason = Season.Autumn;
                    break;

                case Season.Autumn:
                    CurrentSeason = Season.Winter;
                    break;

                case Season.Winter:
                    CurrentSeason = Season.Spring;
                    break;
                }
            }
            IsCollaborating = false;
            ReprioritizeGoals();
        }
Exemplo n.º 2
0
        internal virtual void Advance(IAction activity)
        {
            Log.Add("");
            Log.Add(CurrentSeason.ToString() + " " + _seasonList.Count() / 4);
            _seasonList.Add(activity);
            activity.Act(this);
            if (SeasonalAge >= 140)
            {
                Age(LongevityRitual);
            }
            switch (CurrentSeason)
            {
            case Season.Spring:
                CurrentSeason = Season.Summer;
                break;

            case Season.Summer:
                CurrentSeason = Season.Autumn;
                break;

            case Season.Autumn:
                CurrentSeason = Season.Winter;
                break;

            case Season.Winter:
                CurrentSeason = Season.Spring;
                break;
            }
            IsCollaborating = true;
        }
Exemplo n.º 3
0
    public int ChangeSeasons()
    {
        switch (mySeason)
        {
        case CurrentSeason.Spring:
            Summer();
            mySeason = CurrentSeason.Summer;
            return(1);

            break;

        case CurrentSeason.Summer:
            Autumn();
            mySeason = CurrentSeason.Autumn;
            return(2);

            break;

        case CurrentSeason.Autumn:
            Winter();
            mySeason = CurrentSeason.Winter;
            return(3);

            break;

        case CurrentSeason.Winter:
            Spring();
            mySeason = CurrentSeason.Spring;
            return(0);

            break;
        }

        return(999);
    }
Exemplo n.º 4
0
        public void StartNewSeason(long leagueId, long teamId)
        {
            CurrentSeason newSeason = new CurrentSeason();

            /*newSeason.Number = currentSeason.Number + 1;
            newSeason.StartYear = currentSeason.EndYear;
            newSeason.EndYear = newSeason.EndYear + 1;*/

            this.currentSeason = newSeason;
        }
Exemplo n.º 5
0
    private void Start()
    {
        //TimeManager.OnTick += calendarUpdate;
        PseudoMain.OnTick += calendarUpdate;
        CurrentMonth       = Months.January;
        CurrentWeek        = 1;
        CurrentYear        = 1;
        CurrentSeason      = Seasons.Winter;

        seasonDisplay.text = CurrentSeason.ToString();
        dateDisplay.text   = "Week " + CurrentWeek + " of " + CurrentMonth + ", Year " + CurrentYear;
    }
Exemplo n.º 6
0
        public async Task PlayerStats([Remainder] string playerLookup)
        {
            EmbedBuilder embed   = new EmbedBuilder();
            var          options = new RequestOptions {
                Timeout = 2
            };
            await Context.Message.DeleteAsync(options);

            try
            {
                if (Context.Channel.Id == Convert.ToUInt64(Environment.GetEnvironmentVariable("stats_channel")) || Context.Channel.Id == 711778374720421918 || Context.Channel.Id == 713176040716894208)
                {
                    var(player, playerName) = CurrentSeason.SeasonStats(playerLookup);
                    if (player == null || !player.Any())
                    {
                        await ReplyAsync($"{Context.User.Mention}, it doesn't appear that ``{playerName}`` has any stats for the current regular season.");

                        return;
                    }
                    else
                    {
                        PlayerBuilder(player, ref embed);
                        embed.Footer = new EmbedFooterBuilder
                        {
                            Text    = "leaguegaming.com",
                            IconUrl = "https://www.leaguegaming.com/images/logo/logonew.png"
                        };
                        foreach (var pStat in player)
                        {
                            embed.Title = $"{pStat.PlayerName} (Recent POS: {pStat.Position.Trim()})";
                            embed.WithUrl(pStat.PlayerUrl);
                            embed.Color = new Color(0x26A20B);
                            embed.WithCurrentTimestamp();
                        }
                        await ReplyAsync("", embed : embed.Build());
                    }
                }
                else
                {
                    await ReplyAsync(
                        $"{Context.User.Mention} you are using the command in the wrong channel, try again in " +
                        $"{MentionUtils.MentionChannel(Convert.ToUInt64(Environment.GetEnvironmentVariable("stats_channel")))}");
                }
            }
            catch (NullReferenceException)
            {
                await ReplyAsync(
                    $"{Context.User.Mention} there was an error finding {playerLookup}.  Please try again using quotes around the gamer tag.");
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Returns true if PlayerLegendStatistics instances are equal
        /// </summary>
        /// <param name="input">Instance of PlayerLegendStatistics to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PlayerLegendStatistics?input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     CurrentSeason == input.CurrentSeason ||
                     (CurrentSeason != null &&
                      CurrentSeason.Equals(input.CurrentSeason))
                     ) &&
                 (
                     PreviousVersusSeason == input.PreviousVersusSeason ||
                     (PreviousVersusSeason != null &&
                      PreviousVersusSeason.Equals(input.PreviousVersusSeason))
                 ) &&
                 (
                     BestVersusSeason == input.BestVersusSeason ||
                     (BestVersusSeason != null &&
                      BestVersusSeason.Equals(input.BestVersusSeason))
                 ) &&
                 (
                     LegendTrophies == input.LegendTrophies ||
                     LegendTrophies.Equals(input.LegendTrophies)
                 ) &&
                 (
                     PreviousSeason == input.PreviousSeason ||
                     (PreviousSeason != null &&
                      PreviousSeason.Equals(input.PreviousSeason))
                 ) &&
                 (
                     BestSeason == input.BestSeason ||
                     (BestSeason != null &&
                      BestSeason.Equals(input.BestSeason))
                 ));
        }
Exemplo n.º 8
0
    public void LoadInfo(CurrentSeason info)
    {
        mySeason = info;

        switch (mySeason)
        {
        case CurrentSeason.Summer:
            Summer();
            break;

        case CurrentSeason.Autumn:
            Autumn();
            break;

        case CurrentSeason.Winter:
            Winter();
            break;

        case CurrentSeason.Spring:
            Spring();
            break;
        }
    }
Exemplo n.º 9
0
    private void calendarUpdate(object sender, PseudoMain.OnTickEventArgs e)
    {
        int thisTick = e.tick;

        CurrentWeek++;
        if (CurrentWeek > 4)
        {
            CurrentWeek -= 4;
            CurrentMonth++;
            if ((int)CurrentMonth == 3)
            {
                CurrentSeason = Seasons.Spring;
            }
            else if ((int)CurrentMonth == 6)
            {
                CurrentSeason = Seasons.Summer;
            }
            else if ((int)CurrentMonth == 9)
            {
                CurrentSeason = Seasons.Fall;
            }
            else if ((int)CurrentMonth == 12)
            {
                CurrentSeason = Seasons.Winter;
            }
            else if ((int)CurrentMonth > 12)
            {
                CurrentMonth = Months.January;
                CurrentYear++;
            }
        }


        seasonDisplay.text = CurrentSeason.ToString();
        dateDisplay.text   = "Week " + CurrentWeek + " of " + CurrentMonth + ", Year " + CurrentYear;
    }
Exemplo n.º 10
0
 public Challenge GetChallengeById(int challengeId)
 {
     return(CurrentSeason?.GetChallengeById(challengeId));
 }
Exemplo n.º 11
0
 private void GetEventsForSeason()
 {
     _currentSeasonEvents = CurrentSeason.SelectRandomizedEvents(eventsPerSeason).ToList();
 }