コード例 #1
0
 public bool MeetsCriteria(Farmer who, string locationName, WaterType waterType, SDate date, Weather weather, int time, int fishingLevel, int?mineLevel)
 {
     return((this.InvertLocations ^ (this.Location == null || locationName == this.Location)) &&
            (this.WaterType & waterType) != 0 &&
            (this.Season & date.GetSeason()) != 0 &&
            (this.Weather & weather) != 0 &&
            this.FishingLevel <= fishingLevel &&
            (this.MineLevel == null || this.MineLevel == mineLevel));
 }
コード例 #2
0
ファイル: FishData.cs プロジェクト: somnomania/smapi-mod-dump
 public bool MeetsCriteria(int fish, WaterType waterType, SDate date, Weather weather, int time, int level)
 {
     // Note: HasFlag won't work because these are checking for an intersection, not for a single bit
     return((this.WaterType & waterType) > 0 &&
            (this.Season & date.GetSeason()) > 0 &&
            (this.Weather & weather) > 0 &&
            level >= this.MinLevel &&
            this.Times.Any(t => time >= t.Start && time < t.Finish));
 }