Beispiel #1
0
        private void DoCombat(object sender, ElapsedEventArgs e)
        {
            //Server.Current.Log("DoCombat");
            foreach (var combat in Fights.ToArray())
            {
                try
                {
                    if (combat.Fighting) // could've ended on another thread
                    {
                        combat.Round(_combatTickRate);
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }

                // end fight
                if (!combat.Fighting)
                {
                    combat.End();
                    Fights.Remove(combat);
                }
            }
        }
Beispiel #2
0
 public void RemoveFight(Fight fight)
 {
     lock (Fights)
         Fights.Remove(fight);
 }