当前位置: 首页>>代码示例>>C#>>正文


C# Play.ControllableObject类代码示例

本文整理汇总了C#中Octgn.Play.ControllableObject的典型用法代码示例。如果您正苦于以下问题:C# ControllableObject类的具体用法?C# ControllableObject怎么用?C# ControllableObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ControllableObject类属于Octgn.Play命名空间,在下文中一共展示了ControllableObject类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:6,代码来源:ClientHandler.cs

示例2: TakeFrom

 public void TakeFrom(ControllableObject obj, Player to)
 {
     obj.TakingControl(to);
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:4,代码来源:ClientHandler.cs

示例3: DontTakeReq

		public void DontTakeReq(ControllableObject id, Player to)
		{
						//Log.Info("[ProtOut] DontTakeReq");
					    if(Program.Client == null)return;
			MemoryStream stream = new MemoryStream(512);
			stream.Seek(4, SeekOrigin.Begin);
			BinaryWriter writer = new BinaryWriter(stream);

      if (Program.Client.Muted != 0)
          writer.Write(Program.Client.Muted);
      else
          writer.Write(0);
			writer.Write((byte)62);
			writer.Write(id.Id);
			writer.Write(to.Id);
			writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
			writer.Write((int)stream.Length);
			writer.Close();
			Send(stream.ToArray());
		}
开发者ID:rexperalta,项目名称:OCTGN,代码行数:20,代码来源:BinaryStubs.cs

示例4: DontTake

 public void DontTake(ControllableObject obj)
 {
     obj.DontTakeError();
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:4,代码来源:ClientHandler.cs

示例5: TakeFromReq

        public void TakeFromReq(ControllableObject id, Player from)
        {
            StringBuilder sb = new StringBuilder();
            XmlWriter writer = XmlWriter.Create(sb, xmlSettings);

            writer.WriteStartElement("TakeFromReq");
            if (Script.ScriptEngine.CurrentScript != null && Script.ScriptEngine.CurrentScript.muted)
              writer.WriteAttributeString("muted", Script.ScriptEngine.CurrentScript.GetUniqueId().ToString(CultureInfo.InvariantCulture));
              else if (Program.Client.Muted != 0)
              writer.WriteAttributeString("muted", Program.Client.Muted.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("id", id.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("from", from.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement();
            writer.Close();
            Send(sb.ToString());
        }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:16,代码来源:XmlStubs.cs

示例6: PassToReq

        public void PassToReq(ControllableObject id, Player to, bool requested)
        {
            MemoryStream stream = new MemoryStream(512);
            stream.Seek(4, SeekOrigin.Begin);
            BinaryWriter writer = new BinaryWriter(stream);

              if (Program.Client.Muted != 0)
              writer.Write(Program.Client.Muted);
              else
              writer.Write(0);
            writer.Write((byte)64);
            writer.Write(id.Id);
            writer.Write(to.Id);
            writer.Write(requested);
            writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
            writer.Write((int)stream.Length);
            writer.Close();
            Send(stream.ToArray());
        }
开发者ID:IanWhalen,项目名称:OCTGN,代码行数:19,代码来源:BinaryStubs.cs

示例7: TakeFromReq

        public void TakeFromReq(ControllableObject id, Player from)
        {
            if(Program.Client == null)return;
            MemoryStream stream = new MemoryStream(512);
            stream.Seek(4, SeekOrigin.Begin);
            BinaryWriter writer = new BinaryWriter(stream);

              if (Program.Client.Muted != 0)
              writer.Write(Program.Client.Muted);
              else
              writer.Write(0);
            writer.Write((byte)66);
            writer.Write(id.Id);
            writer.Write(from.Id);

            writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
            writer.Write((int)stream.Length);
            writer.Close();
            Send(stream.ToArray());
        }
开发者ID:saturnattack,项目名称:OCTGN,代码行数:20,代码来源:BinaryStubs.cs

示例8: PassToReq

        public void PassToReq(ControllableObject id, Player to, bool requested)
        {
            StringBuilder sb = new StringBuilder();
            XmlWriter writer = XmlWriter.Create(sb, xmlSettings);

            writer.WriteStartElement("PassToReq");
            if(Program.Client.Muted != 0)
                writer.WriteAttributeString("muted", Program.Client.Muted.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("id", id.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("to", to.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("requested", requested.ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement();
            writer.Close();
            Send(sb.ToString());
        }
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:15,代码来源:XmlStubs.cs

示例9: CopyControllersTo

 // Give to the parameter the same controller as this object
 internal void CopyControllersTo(ControllableObject other)
 {
     if (Controller == null) return;
     other.Controller = Controller;
 }
开发者ID:0M3G4,项目名称:OCTGN,代码行数:6,代码来源:ControllableObject.cs

示例10: 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);
 }
开发者ID:octgn,项目名称:OCTGN,代码行数:89,代码来源:ClientHandler.cs

示例11: CopyControllersTo

 // Give to the parameter the same controller as this object
 internal void CopyControllersTo(ControllableObject other)
 {
     other.Controller = Controller;
 }
开发者ID:Keterr,项目名称:OCTGN,代码行数:5,代码来源:ControllableObject.cs

示例12: TakeFromReq

        public void TakeFromReq(ControllableObject id, Player from)
        {
            MemoryStream stream = new MemoryStream(512);
            stream.Seek(4, SeekOrigin.Begin);
            BinaryWriter writer = new BinaryWriter(stream);

              if (Script.ScriptEngine.CurrentScript != null && Script.ScriptEngine.CurrentScript.muted)
              writer.Write(Script.ScriptEngine.CurrentScript.GetUniqueId());
              else if (Program.Client.Muted != 0)
              writer.Write(Program.Client.Muted);
              else
              writer.Write(0);
            writer.Write((byte)66);
            writer.Write(id.Id);
            writer.Write(from.Id);
            writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
            writer.Write((int)stream.Length);
            writer.Close();
            Send(stream.ToArray());
        }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:20,代码来源:BinaryStubs.cs

示例13: TakeFromReq

        public void TakeFromReq(ControllableObject id, Player from)
        {
            var sb = new StringBuilder();
            XmlWriter writer = XmlWriter.Create(sb, XmlSettings);

            writer.WriteStartElement("TakeFromReq");
            if (Program.Client.Muted != 0)
                writer.WriteAttributeString("muted", Program.Client.Muted.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("id", id.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteElementString("from", from.Id.ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement();
            writer.Close();
            Send(sb.ToString());
        }
开发者ID:0M3G4,项目名称:OCTGN,代码行数:14,代码来源:XmlStubs.cs


注:本文中的Octgn.Play.ControllableObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。