public CorporationManager(IStandingHandler standingHandler, CorporationConfiguration corporationConfiguration, CorporateInvites corporateInvites) { _standingHandler = standingHandler; Settings = corporationConfiguration; Invites = corporateInvites; _timers.Add(new TimerAction(Invites.InviteCycle, TimeSpan.FromSeconds(3.03), true)); _timers.Add(new TimerAction(ScheduleCollectRend, TimeSpan.FromHours(1.07))); //not async _timers.Add(new TimerAction(FinishLeave, TimeSpan.FromSeconds(7.07), true)); _timers.Add(new TimerAction(ScheduleIntrusionIncome, TimeSpan.FromHours(5.013))); //not async }
/// <summary> /// Saves the current state time spent on. /// </summary> void SaveTimer() { StateTimer.Stop(); if (StateTimer.ElapsedMilliseconds >= 1000) { TimerList.Add(new Tuple <string, double> (currentState, StateTimer.ElapsedSeconds)); } StateTimer.Reset(); }
public async ValueTask <ActUpdateResult> Update(CanvasTimingInformation timing) { if (_finished) { return(ActUpdateResult.Finished); } _tempTimers.Update(timing); if (_ghostsChasing) { await _powerPillLegend.Update(timing); await _powerPillToEat.Update(timing); _ghostTimer.Run(timing); _pacTimer.Run(timing); _ghostEatenTimer.Run(timing); } await _pillLegend.Update(timing); _tempSprites.Update(timing); lerpPacMan(); foreach (var g in _ghosts) { if (!g.Alive) { continue; } lerpGhost(g); await g.Update(timing); if (Vector2s.AreNear(_pacMan.Position, g.Position, 2)) { ghostEaten(g); if (g.NickName == GhostNickname.Clyde) { _tempTimers.Add(new EggTimer(1.Seconds(), () => { _finished = true; })); } } } await _pacMan.Update(timing); return(ActUpdateResult.Running); }
public void LoadTimers() { var blub = AppCore.CurrentWorkout.Timers.Where(timer => string.Equals(timer.SetId, this.SetId)).First().Timers; TimerList.Clear(); foreach (var item in blub) { TimerList.Add(item); } //var dbMgr = new DatabaseManager(); //TimerList = dbMgr.LoadTimerList(SetId); //benutze setid um richtgen Datensatz zu ladnen //throw new NotImplementedException(); }
internal CharacterTimers(string charName, IEnumerable <TimerEntry> timers) : base(charName) { var view = CollectionViewSource.GetDefaultView(TimerList); view.SortDescriptions.Add(new SortDescription(nameof(TimerEntry.RemainingTime), ListSortDirection.Ascending)); ((ICollectionViewLiveShaping)view).IsLiveSorting = true; foreach (var timer in timers) { TimerList.Add(timer); } ClearReadyCommand = new CommandWrapper(o => ClearReady(), o => true); }
internal void Merge(IEnumerable <TimerEntry> other) { foreach (var t in other) { var existing = TimerList.FirstOrDefault((x) => x.IsAgent == t.IsAgent && x.ID == t.ID); if (existing != null) { existing.UnlockTime = t.UnlockTime; if (existing.Class != t.Class) { existing.ChangeTimerClass(t.Class); } } else if (!t.IsReady) { TimerList.Add(t); } } }
internal void AddTimer() { TimerList.Add(new AtomicTimer());// { Name = "Timer",Repetitions=1,Duration = new TimeSpan(0,0,1),IsSelected = false}); // throw new NotImplementedException(); }
public ChaseSubAct() { _finished = false; _tempTimers = new TimerList(); _ghostScore = 200; _tempSprites = new TimedSpriteList(); _ghosts = new List <AttractGhost>(); var justOffScreen = new Vector2(250, 140); _ghostEatenTimer = new EggTimer(0.Milliseconds(), () => { }); _ghostTimer = new EggTimer(5.Seconds(), async() => await reverseChase()); _pacTimer = new EggTimer(5.1f.Seconds(), () => { }); _powerPillToEat = new PowerPill { Visible = false, Position = new Vector2(30, justOffScreen.Y - 4) }; _pillLegend = new Pill { Position = new Vector2(70, 178) }; _powerPillLegend = new PowerPill { Position = new Vector2(66, 182) }; _pacMan = new AttractScenePacMan { Direction = Directions.Left }; var blinky = new AttractGhost(GhostNickname.Blinky, Directions.Left); var pinky = new AttractGhost(GhostNickname.Pinky, Directions.Left); var inky = new AttractGhost(GhostNickname.Inky, Directions.Left); var clyde = new AttractGhost(GhostNickname.Clyde, Directions.Left); _ghosts.Add(blinky); _ghosts.Add(pinky); _ghosts.Add(inky); _ghosts.Add(clyde); var gap = new Vector2(16, 0); _pacPositions = new StartAndEndPos(justOffScreen, new Vector2(30, justOffScreen.Y)); _pacMan.Position = _pacPositions.Start; _ghostPositions = new Dictionary <GhostNickname, StartAndEndPos>(); var startPos = justOffScreen + new Vector2(50, 0); var endPos = new Vector2(50, justOffScreen.Y); blinky.Position = startPos; _ghostPositions[blinky.NickName] = new StartAndEndPos(startPos, endPos); startPos = startPos + gap; endPos = endPos + gap; pinky.Position = startPos; _ghostPositions[pinky.NickName] = new StartAndEndPos(startPos, endPos); startPos = startPos + gap; endPos = endPos + gap; inky.Position = startPos; _ghostPositions[inky.NickName] = new StartAndEndPos(startPos, endPos); startPos = startPos + gap; endPos = endPos + gap; clyde.Position = startPos; _ghostPositions[clyde.NickName] = new StartAndEndPos(startPos, endPos); _tempTimers.Add(new EggTimer(1.Seconds(), () => _legendVisible = true)); _tempTimers.Add(new EggTimer(3.Seconds(), () => { _powerPillToEat.Visible = true; _copyrightVisible = true; })); _tempTimers.Add(new EggTimer(4500.Milliseconds(), () => { _ghostsChasing = true; })); }