private void Gameover() { vreme.Stop(); SpawnTimer.Stop(); MoveTimer.Stop(); ReduceSpeed.Stop(); GameOver go = new GameOver(lbScore.Text); DialogResult res = go.ShowDialog(); if (res == System.Windows.Forms.DialogResult.Retry) { veg.Clear(); score = 0; lbTime.Text = "60"; lbScore.Text = "0"; vreme.Start(); SpawnTimer.Start(); MoveTimer.Start(); pb1.Visible = true; pb2.Visible = true; pb3.Visible = true; canvas.Invalidate(); SpawnTimer.Interval = 10; progress.Value = 60; isPressed = false; ReduceSpeed.Start(); } }
private void StopSpawnTimer() { if (m_SpawnTimer != null) { m_SpawnTimer.Stop(); m_SpawnTimer = null; } }
private void StopTimers() { SumWriter.Stop(); CategoryWriter.Stop(); YearlyWriter.Stop(); NotifyTimer.Stop(); SpawnTimer.Stop(); }
public int Spawn() { long tick = DateTime.Now.Ticks; LastThinktime = tick; // TODO: check for respawn and bla // Reset status if no respawn Status = new WorldObjectStatus(this); Status.CalculateMonster(true); AttackedID = WorldID.Null; TargetID = WorldID.Null; MoveFailCount = 0; // Respawn timer kill if (SpawnTimer != null) { SpawnTimer.Stop(); } MasterID = WorldID.Null; MasterDistance = 0; Aggressive = ((Database.Status.Mode & EMonsterMode.Angry) > 0 ? true : false); SkillState = EMonsterSkillState.Idle; NextWalktime = tick + (new Random().Next(5000) + 1000); LastLinktime = tick; LastPcNeartime = 0; SkillDelays.Clear(); DamageLog.Clear(); LootItem.Clear(); if (Database.Option != EStatusOption.Nothing) { StatusChange.Option = Database.Option; } // Push to world World.Objects.Add(this); // Push to map Location.Map.OnEnter(this); Network.Packets.WorldObjectSpawn.Send(this, true); //skill_unit_move(&md->bl,tick,1); //mobskill_use(md, tick, MSC_SPAWN); return(1); }
private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { if (isDirectoryFinished) { SpawnTimer.Stop(); return; } if (fileList == null) { fileList = EnqeueFileList(); } if (!Int32.TryParse(ThreadBox.Text, out int desiredThreadNumber)) { MessageBox.Show("Podano błędną wartość ilości wątków"); return; } if (fileList.Count <= desiredThreadNumber) { AddToLog("Zlecono przetwarzanie ostatniej partii danych, proszę czekać na ostateczne wyniki"); desiredThreadNumber = fileList.Count; isDirectoryFinished = true; } for (int i = 0; i < desiredThreadNumber; i++) { if (threadList.ContainsKey(i) && threadList[i].ThreadState != ThreadState.Stopped) { continue; } Thread t = new Thread(() => { Thread.CurrentThread.IsBackground = true; //niepotrzebny jeśli aplikacja się zamyka try { Reader worker = new Reader(this); worker.ProcessFile(fileList.Dequeue().FullName); } catch (Exception exception) { AddToLog("Wystąpił nieznany błąd przy tworzeniu nowego wątku, jeśli problem się powtarza: skontaktuj się z dostawcą programu\r\n" + exception.Message); } }); threadList[i] = t; threadList[i].Start(); } }