public static TimeBoostProfile EnsureProfile(IAccount a) { TimeBoostProfile profile = null; Profiles.AddOrReplace(a, p => profile = p ?? new TimeBoostProfile(a)); return(profile); }
private static bool Deserialize(GenericReader reader) { reader.GetVersion(); reader.ReadBlockDictionary( r => { var k = r.ReadAccount(); var v = new TimeBoostProfile(r); return(new KeyValuePair <IAccount, TimeBoostProfile>(k, v)); }, Profiles); return(true); }
public TimeBoostsUI( Mobile user, Gump parent = null, TimeBoostProfile profile = null, Func <ITimeBoost, bool> canApply = null, Action <ITimeBoost> boostUsed = null, Func <TimeSpan> getTime = null, Action <TimeSpan> setTime = null) : base(user, parent) { Profile = profile; CanApply = canApply; BoostUsed = boostUsed; GetTime = getTime; SetTime = setTime; Title = DefaultTitle; SubTitle = DefaultSubTitle; EmptyText = DefaultEmptyText; SummaryText = DefaultSummaryText; TitleColor = DefaultTitleColor; SubTitleColor = DefaultSubTitleColor; EmptyTextColor = DefaultEmptyTextColor; BoostTextColor = DefaultBoostTextColor; BoostCountColor = DefaultBoostCountColor; SummaryTextColor = DefaultSummaryTextColor; EntriesPerPage = 4; Sorted = true; CanClose = true; CanDispose = true; CanMove = true; CanResize = false; AutoRefreshRate = TimeSpan.FromMinutes(1.0); AutoRefresh = true; ForceRecompile = true; }