当前位置: 首页>>代码示例>>C#>>正文


C# Season类代码示例

本文整理汇总了C#中Season的典型用法代码示例。如果您正苦于以下问题:C# Season类的具体用法?C# Season怎么用?C# Season使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Season类属于命名空间,在下文中一共展示了Season类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetSeasonDateRange

        /// <summary>
        /// Retrieves the date range for the season based on season and year.
        /// </summary>
        /// <param name="season">
        /// The season you wish to get the date range for.
        /// </param>
        /// <param name="year">
        /// The year of the season you wish to get the date range for.
        /// </param>
        /// <param name="restated">
        /// Set to true if you want the time period adjusted forward in 53 week years for comparability to 52 week years.
        /// </param>
        /// <returns>
        /// DateRange
        /// </returns>
        public static DateRange GetSeasonDateRange(Season season,
            int year,
            bool restated = false)
        {
            // Default to Spring season, weeks 1 through 26.
            var startWeek = 1;
            var endWeek = 26;

            if (season == Season.Fall)
            {
                // Check whether the year has a 53rd week.
                var extraWeek = GetMerchYearInfo(year).ExtraWeek;

                startWeek = 27;

                /* If the year has an extra week and the time period has not been restated, end on
                 * 53rd week, otherwise end on 52nd. */
                if (extraWeek && !restated)
                    endWeek = 53;
                else
                    endWeek = 52;
            }

            var startDate = GetWeekDateRange(startWeek, year, restated).StartDate;
            var endDate = GetWeekDateRange(endWeek, year, restated).EndDate.ToEndOfDay();

            return new DateRange
            {
                StartDate = startDate,
                EndDate = endDate
            };
        }
开发者ID:mhertzfeld,项目名称:MerchandiseCalendar,代码行数:47,代码来源:SeasonFunctions.cs

示例2: ChangeColor

 public virtual void ChangeColor(Season season)
 {
     switch (season)
     {
         case Season.Winter:
             {
                 color = TreeColor.Brown;
                 break;
             }
         case Season.Spring:
             {
                 color = TreeColor.LightGreen;
                 break;
             }
         case Season.Summer:
             {
                 color = TreeColor.Green;
                 break;
             }
         case Season.Autumn:
             {
                 color = TreeColor.Yellow;
                 break;
             }
         default:
             {
                 break;
             }
     }
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:30,代码来源:AbstractTree.cs

示例3: Tree

 public Tree(Season season)
 {
     countOfDays = Counting();
     this.season = season;
     var msMessanger = new Messanger(this);
     Options();
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:7,代码来源:Tree.cs

示例4: Time

        public Time(string pod, string pow, string ss)
        {
            if (pod == "Morning")
                period_of_day = Time.Period_Of_Day.Morning;
            else if (pod == "Afternoon")
                period_of_day = Time.Period_Of_Day.Afternoon;
            else if (pod == "Night")
                period_of_day = Time.Period_Of_Day.Night;
            else
                period_of_day = Time.Period_Of_Day.All;

            
            if (pow == "Weekday")
                period_of_week = Time.Period_Of_Week.Weekday;
            else if (pow == "Weekend")
                period_of_week = Time.Period_Of_Week.Weekend;
            else
                period_of_week = Time.Period_Of_Week.All;

            
            if (ss == "Spring")
                season = Time.Season.Spring;
            else if (ss == "Summer")
                season = Time.Season.Summer;
            else if (ss == "Autumn")
                season = Time.Season.Autumn;
            else if (ss == "Winter")
                season = Time.Season.Winter;
            else
                season = Time.Season.All;
        }
开发者ID:tiemptit,项目名称:travelh2v,代码行数:31,代码来源:Time.cs

示例5: Practice

        private List<Inning> innings; // The innings associated with this game.

        #endregion Fields

        #region Constructors

        public Practice(Season newSeason, DateTime newDate, String newLocation)
        {
            season = newSeason;
            date = newDate;
            location = newLocation;
            innings = new List<Inning>();
        }
开发者ID:kjlahm,项目名称:Dugout-Digits,代码行数:13,代码来源:Practice.cs

示例6: Context

        public Context(State initialState, Season initialSeason)
        {
            if (initialState == null) throw new ArgumentNullException("initialState");

              currentState = initialState;
              CurrentSeason = initialSeason;
        }
开发者ID:headsigned,项目名称:csharp-state-pattern-encapsulation-example,代码行数:7,代码来源:Context.cs

示例7: GetSeasonWithOneRace

        public static Season GetSeasonWithOneRace()
        {
            var season = new Season()
            {
                Id = ++SeasonId,
                Name = "Test Season",
                PointsSystemTypeName = "atomicf1.domain.PointsSystem2011, atomicf1.domain"
            };

            season.AddRace(Race(season, new List<RaceEntry>() {
                RaceEntry(season.PointsSystem, 1),
                RaceEntry(season.PointsSystem, 2),
                RaceEntry(season.PointsSystem, 3),
                RaceEntry(season.PointsSystem, 4),
                RaceEntry(season.PointsSystem, 5),
                RaceEntry(season.PointsSystem, 6),
                RaceEntry(season.PointsSystem, 7),
                RaceEntry(season.PointsSystem, 8),
                RaceEntry(season.PointsSystem, 9),
                RaceEntry(season.PointsSystem, 10),
                RaceEntry(season.PointsSystem, 11) }
                ));

            return season;
        }
开发者ID:robgray,项目名称:f1speedguides,代码行数:25,代码来源:FakesFactory.cs

示例8: GrabMethods

	//called by lvl change
	private void GrabMethods(){ 
		background = GameObject.Find("Background");
		//player = GameObject.Find("Player").GetComponent<PlayerController>();
		scenery = background.GetComponent<Animator>();
		sea =  SeasonExtension.ToSeason(scenery.GetInteger("Season"));
		targets = GetEffectedArray();
	}
开发者ID:fondreak,项目名称:FailSeason,代码行数:8,代码来源:GameController.cs

示例9: CalculateWatchedPercentage

 private static decimal CalculateWatchedPercentage(Season season)
 {
     var episodes = season.Unwatched + season.Watched;
     decimal watchedEpisodes = season.Watched;
     decimal result = watchedEpisodes / episodes;
     return Math.Round(result * 100);
 }
开发者ID:ja1984,项目名称:TweeWeb,代码行数:7,代码来源:UserController.cs

示例10: GetStatsSummaryAsync

 /// <summary>
 /// Gets aggregated stats for a summoner. This method uses the Stats API.
 /// </summary>
 /// <param name="summonerId">The summoner's summoner IDs.</param>
 /// <param name="season">The season to get stats for. If unspecified, stats for the current season are returned.</param>
 /// <returns>A task representing the asynchronous operation.</returns>
 public Task<PlayerStatsSummaryList> GetStatsSummaryAsync(long summonerId, Season? season = null)
 {
     var queryParameters = new Dictionary<string, object>();
     if (season != null)
         queryParameters["season"] = season;
     return GetAsync<PlayerStatsSummaryList>($"{mainBaseUrl}/api/lol/{lowerRegion}/{StatsApiVersion}/stats/by-summoner/{summonerId}/summary", queryParameters);
 }
开发者ID:aj-r,项目名称:RiotNet,代码行数:13,代码来源:RiotClientStats.cs

示例11: VisSource

 public VisSource(Aura aura, Ability art, Season seasons, double amount)
 {
     Aura = aura;
     Art = art;
     Seasons = seasons;
     Amount = amount;
 }
开发者ID:ndilday,项目名称:wizard-monks,代码行数:7,代码来源:Aura.cs

示例12: SetSeason

 public void SetSeason(Season season)
 {
     foreach (var tree in _trees)
     {
         tree.TreeOption(season);
     }
 }
开发者ID:vbre,项目名称:CS_2015_Winter,代码行数:7,代码来源:MyForest.cs

示例13: CreateNextSeason

 // TODO Lookup current season
 public Season CreateNextSeason(Season currentSeason)
 {
     if (currentSeason != null && currentSeason.StartYear == DateTime.Today.Year)
         return null;
     else
         return new Season(DateTime.Today.Year, DateTime.Today.Year + 1);
 }
开发者ID:philjhale,项目名称:TeessideBasketballLeague,代码行数:8,代码来源:CompetitionServiceOld.cs

示例14: Transition

 //Boilerplate to make sure that the object-specific transitions only happen when needed
 //Also helps remember to actually set the current season
 public void Transition(Season toSeason)
 {
     if (currentSeason != toSeason) {
         DoTransition(toSeason);
         currentSeason = toSeason;
     }
 }
开发者ID:kmoverall,项目名称:azimuth-unity,代码行数:9,代码来源:SeasonalObject.cs

示例15: Index

        public ActionResult Index(string userName)
        {
            var backup = RavenSession.Query<Backup>().FirstOrDefault(x => x.Username == userName);

            if (backup.Shows.Any(x => x.Seasons != null && x.Seasons.Any()))
                return View(backup);

            foreach (var show in backup.Shows)
            {
                var seasons = show.Episodes.GroupBy(x => x.Season);
                show.Seasons = new List<Season>();
                foreach (var season in seasons)
                {
                    var newSeason = new Season()
                                        {
                                            Number = int.Parse(season.Key),
                                            Unwatched = season.Count(x => x.Watched == "0"),
                                            Watched = season.Count(x => x.Watched == "1"),
                                        };
                    newSeason.Percent = CalculateWatchedPercentage(newSeason);
                    show.Seasons.Add(newSeason);

                }
            }

            RavenSession.Store(backup);
            RavenSession.SaveChanges();

            return View(backup);
        }
开发者ID:ja1984,项目名称:TweeWeb,代码行数:30,代码来源:UserController.cs


注:本文中的Season类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。