Ejemplo n.º 1
0
 /// <summary>Creates new Cards as well as the corresponding CardIdentities. All cards are created in the same group.</summary>
 /// <param name="id">An array with the new CardIdentity ids.</param>
 /// <param name="type">An array containing the corresponding CardModel guids (encrypted)</param>
 /// <param name="group">The group, in which the cards are added.</param>
 /// <seealso cref="CreateCard(int[], ulong[], Group[])"> to add cards to several groups</seealso>
 public void CreateCard(int[] id, ulong[] type, Group group)
 {
     Player owner = Player.Find((byte)(id[0] >> 16));
     if (owner == null)
     {
         Program.Trace.TraceEvent(TraceEventType.Warning, EventIds.Event, "[CreateCard] Player not found.");
         return;
     }
     // Ignore cards created by oneself
     if (owner == Player.LocalPlayer) return;
     for (int i = 0; i < id.Length; i++)
     {
         Card c = new Card(owner, id[i], type[i], Program.Game.Definition.CardDefinition, null, false);
         group.AddAt(c, group.Count);
     }
 }