本文整理汇总了C#中Octgn.Play.ControllableObject.PassControlTo方法的典型用法代码示例。如果您正苦于以下问题:C# ControllableObject.PassControlTo方法的具体用法?C# ControllableObject.PassControlTo怎么用?C# ControllableObject.PassControlTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Octgn.Play.ControllableObject
的用法示例。
在下文中一共展示了ControllableObject.PassControlTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PassTo
public void PassTo(Player who, ControllableObject obj, Player player, bool requested)
{
// Ignore message that we sent in the first place
if (who != Player.LocalPlayer)
obj.PassControlTo(player, who, false, requested);
}
示例2: PassTo
/// <summary>Completely remove all aliases from a group, e.g. before performing a shuffle.</summary>
/// <param name="group">The group to remove all aliases from.</param>
//public void UnaliasGrp(Group group)
//{
// // Get the group
// Pile g = group as Pile;
// if (g == null)
// { Program.Trace.TraceEvent(TraceEventType.Warning, EventIds.NonGame, "[UnaliasGrp] Group is not a pile."); return; }
// // Collect aliases which we p
// List<int> cards = new List<int>(g.Count);
// List<ulong> types = new List<ulong>(g.Count);
// bool hasAlias = false;
// foreach (Card t in g)
// {
// CardIdentity ci = t.Type;
// if (ci == null) continue; //Hack, should this ever be null? Sometimes it happens for whatever reason.
// if (!ci.Alias) continue;
// hasAlias = true;
// if (ci.MySecret)
// { cards.Add(t.Id); types.Add(ci.Key); }
// }
// // Unalias cards that we know (if any)
// if (cards.Count > 0)
// Program.Client.Rpc.Unalias(cards.ToArray(), types.ToArray());
// // If there are no alias, we may be ready to shuffle
// if (!hasAlias && g.WantToShuffle)
// { g.DoShuffle(); return; }
// // Mark the group for shuffling
// g.PreparingShuffle = true;
// // Notify the user
// Program.TracePlayerEvent(group.Owner, "{0} is being prepared for shuffle.", g);
// // Check for null because the chat can currently be muted (e.g. during a Mulligan scripted action)
// if (Program.LastChatTrace != null)
// g.ShuffledTrace += (new ShuffleTraceChatHandler { Line = Program.LastChatTrace }).ReplaceText;
//}
/// <summary>Unalias some Cards, e.g. before a shuffle</summary>
/// <param name="card">An array containing the Card ids to unalias.</param>
/// <param name="type">An array containing the corresponding revealed CardIdentity ids.</param>
//public void Unalias(int[] card, ulong[] type)
//{
// if (card.Length != type.Length)
// { Program.TraceWarning("[Unalias] Card and type lengths don't match."); return; }
// Pile g = null;
// List<int> cards = new List<int>(card.Length);
// List<ulong> types = new List<ulong>(card.Length);
// for (int i = 0; i < card.Length; i++)
// {
// Card c = Card.Find(card[i]);
// if (c == null)
// { Program.TraceWarning("[Unalias] Card not found."); continue; }
// if (g == null) g = c.Group as Pile;
// else if (g != c.Group)
// { Program.TraceWarning("[Unalias] Not all cards belong to the same group!"); continue; }
// // Check nobody cheated
// if (!c.Type.MySecret)
// {
// if (c.Type.Key != Crypto.ModExp(type[i]))
// Program.TraceWarning("[Unalias] Card identity doesn't match.");
// }
// // Substitue the card's identity
// CardIdentity ci = CardIdentity.Find((int)type[i]);
// if (ci == null)
// { Program.TraceWarning("[Unalias] Card identity not found."); continue; }
// CardIdentity.Delete(c.Type.Id); c.Type = ci;
// // Propagate unaliasing
// if (ci.Alias && ci.MySecret)
// cards.Add(c.Id); types.Add(ci.Key);
// }
// if (cards.Count > 0)
// Program.Client.Rpc.Unalias(cards.ToArray(), types.ToArray());
// if (g == null) return;
// if (!g.PreparingShuffle)
// { Program.TraceWarning("[Unalias] Cards revealed are not in a group prepared for shuffle."); return; }
// // If all cards are now revealed, one can proceed to shuffling
// if (!g.WantToShuffle) return;
// bool done = false;
// for (int i = 0; !done && i < g.Count; i++)
// done = g[i].Type.Alias;
// if (!done)
// g.DoShuffle();
//}
public void PassTo(Player who, ControllableObject obj, Player player, bool requested)
{
// Ignore message that we sent in the first place
if (who != Player.LocalPlayer)
obj.PassControlTo(player, who, false, requested);
if (obj is Card)
Program.GameEngine.EventProxy.OnCardControllerChanged_3_1_0_2((Card)obj, who, player);
}