本文整理汇总了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
};
}
示例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;
}
}
}
示例3: Tree
public Tree(Season season)
{
countOfDays = Counting();
this.season = season;
var msMessanger = new Messanger(this);
Options();
}
示例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;
}
示例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>();
}
示例6: Context
public Context(State initialState, Season initialSeason)
{
if (initialState == null) throw new ArgumentNullException("initialState");
currentState = initialState;
CurrentSeason = initialSeason;
}
示例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;
}
示例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();
}
示例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);
}
示例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);
}
示例11: VisSource
public VisSource(Aura aura, Ability art, Season seasons, double amount)
{
Aura = aura;
Art = art;
Seasons = seasons;
Amount = amount;
}
示例12: SetSeason
public void SetSeason(Season season)
{
foreach (var tree in _trees)
{
tree.TreeOption(season);
}
}
示例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);
}
示例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;
}
}
示例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);
}