Exemplo n.º 1
0
 public void OnNewAlliance(Alliance a)
 {
     if (InvokeRequired)
     {
         Invoke(new AllyEventHandler(OnNewAlliance), a);
         return;
     }
     BindAlliances(_server.Alliances);
 }
Exemplo n.º 2
0
        /// <summary>
        ///     Creates or gets a alliance.
        /// </summary>
        /// <param name="id">Alliance id.</param>
        /// <returns>Created or found alliance.</returns>
        public Alliance CreateAlliance(int id)
        {
            if (Alliances.ContainsKey(id))
            {
                return Alliances[id];
            }

            var a = new Alliance(id);
            Alliances.Add(id, a);

            if (OnNewAlliance != null)
            {
                OnNewAlliance.Invoke(a);
            }

            return a;
        }