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


C# Play.Card类代码示例

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


Card类属于Octgn.Play命名空间,在下文中一共展示了Card类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AddMarkerReq

        public void AddMarkerReq(Card card, Guid id, string name, ushort count, ushort origCount, bool isScriptChange)
        {
            //Log.Info("[ProtOut] AddMarkerReq");

            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)59);
            writer.Write(card.Id);
            writer.Write(id.ToByteArray());
            writer.Write(name);
            writer.Write(count);
            writer.Write(origCount);
            writer.Write(isScriptChange);

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

示例2: AddMarker

        public void AddMarker(Player player, Card card, Guid id, string name, ushort count, ushort oldCount, bool isScriptChange)
        {
            DataNew.Entities.Marker model = Program.GameEngine.GetMarkerModel(id);
            DefaultMarkerModel defaultMarkerModel = model as DefaultMarkerModel;
            if (defaultMarkerModel != null)
                (defaultMarkerModel).SetName(name);
            Marker marker = card.FindMarker(id, name);
            if (player != Player.LocalPlayer)
            {
                if (marker == null && oldCount != 0)
                {
                    Program.GameMess.Warning("Inconsistent state. Cannot create a marker when that marker already exists.");
                    return;
                }
                if (marker != null && oldCount != marker.Count)
                {
                    Program.GameMess.Warning("Inconsistent state.  Marker count invalid.");
                    return;
                }
                card.AddMarker(model, count);

            }
            if (count != 0)
            {
                int newCount = oldCount + count;
                Program.GameMess.PlayerEvent(player, "adds {0} {1} marker(s) on {2}", count, model.Name, card);
                if (isScriptChange == false)
                {
                    Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_0(card, model.ModelString(), oldCount, newCount, isScriptChange);
                    Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_1(card, model.ModelString(), oldCount, newCount, isScriptChange);
                }
            }
        }
开发者ID:jonbonne,项目名称:OCTGN,代码行数:33,代码来源:ClientHandler.cs

示例3: AddMarker

 public void AddMarker(Player player, Card card, Guid id, string name, ushort count)
 {
     Data.MarkerModel model = Program.Game.GetMarkerModel(id);
     if (model is DefaultMarkerModel)
         ((DefaultMarkerModel)model).SetName(name);
     // Ignore markers created by oneself (already created for responsiveness issues)
     if (player != Player.LocalPlayer)
         card.AddMarker(model, count);
     if (count != 0)
         Program.Trace.TraceEvent(TraceEventType.Information, EventIds.Event | EventIds.PlayerFlag(player),
           "{0} adds {1} {2} marker(s) on {3}", player, count, model, card);
 }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:12,代码来源:ClientHandler.cs

示例4: AddMarkerReq

        public void AddMarkerReq(Card card, Guid id, string name, ushort count)
        {
            StringBuilder sb = new StringBuilder();
            XmlWriter writer = XmlWriter.Create(sb, xmlSettings);

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

示例5: OnCardDoubleClick

        public void OnCardDoubleClick(Card card, int mouseButton, string[] keysDown)
        {
            Log.Info("Firing event OnCardDoubleClick");
            var args = new object[3];
            args[0] = card;
            args[1] = mouseButton;
            args[2] = keysDown;

            if(Program.GameEngine.Definition.Events.ContainsKey("OnCardDoubleClick"))
            {
                foreach(var e in Program.GameEngine.Definition.Events["OnCardDoubleClick"])
                {
                    Log.InfoFormat("Firing event OnCardDoubleClick -> {0}",e.Name);
                    engine.ExecuteFunction(e.PythonFunction,card, mouseButton, keysDown);
                }
              	}
        }
开发者ID:sbarnabas,项目名称:OCTGN,代码行数:17,代码来源:GameEvents.cs

示例6: CardSwitchTo

        public void CardSwitchTo(Player player, Card card, string alternate)
        {
            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)87);
            writer.Write(player.Id);
            writer.Write(card.Id);
            writer.Write(alternate);
            writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
            writer.Write((int)stream.Length);
            writer.Close();
            Send(stream.ToArray());
        }
开发者ID:haplo63,项目名称:OCTGN,代码行数:19,代码来源:BinaryStubs.cs

示例7: AddMarkerReq

        public void AddMarkerReq(Card card, Guid id, string name, ushort count)
        {
            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)56);
            writer.Write(card.Id);
            writer.Write(id.ToByteArray());
            writer.Write(name);
            writer.Write(count);
            writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
            writer.Write((int)stream.Length);
            writer.Close();
            Send(stream.ToArray());
        }
开发者ID:IanWhalen,项目名称:OCTGN,代码行数:20,代码来源:BinaryStubs.cs

示例8: AnchorCard

        public void AnchorCard(Card id, Player player, bool anchor)
        {
            //Log.Info("[ProtOut] AnchorCard");
                        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)97);
            writer.Write(id.Id);
            writer.Write(player.Id);
            writer.Write(anchor);
            writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
            writer.Write((int)stream.Length);
            writer.Close();
            Send(stream.ToArray());
        }
开发者ID:digitalalchemy,项目名称:OCTGN,代码行数:21,代码来源:BinaryStubs.cs

示例9: CreateCard

        /// <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;
            }
            //var c = new Card(owner,id[0], type[0], Program.Game.Definition.CardDefinition, null, false);
            var c = Card.Find(id[0]);

            Program.TracePlayerEvent(owner, "{0} creates {1} {2} in {3}'s {4}", owner.Name, id.Length, c == null ? "card" : c.Name, group.Owner.Name,group.Name);
            // 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);
                var card = new Card(owner,id[i], type[i], null, false);
                group.AddAt(card, group.Count);
            }
        }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:27,代码来源:ClientHandler.cs

示例10: Turn

 public void Turn(Player player, Card card, bool up)
 {
     // Ignore the card we turned ourselves
     if (player == Player.LocalPlayer)
     {
         card.MayBeConsideredFaceUp = false;     // see comment on mayBeConsideredFaceUp
         return;
     }
     new Turn(player, card, up).Do();
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:10,代码来源:ClientHandler.cs

示例11: TargetArrow

 public void TargetArrow(Player player, Card card, Card otherCard)
 {
     // Ignore the card we targeted ourselves
     if (player == Player.LocalPlayer) return;
     new Target(player, card, otherCard, true).Do();
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:6,代码来源:ClientHandler.cs

示例12: Rotate

 public void Rotate(Player player, Card card, CardOrientation rot)
 {
     // Ignore the moves we made ourselves
     if (player == Player.LocalPlayer)
         return;
     new Rotate(player, card, rot).Do();
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:7,代码来源:ClientHandler.cs

示例13: CardSwitchTo

 public void CardSwitchTo(Player player, Card card, string alternate)
 {
     if(player.Id != Player.LocalPlayer.Id)
         card.SwitchTo(player, alternate);
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:5,代码来源:ClientHandler.cs

示例14: Peek

 public void Peek(Player player, Card card)
 {
     if (!card.PeekingPlayers.Contains(player))
         card.PeekingPlayers.Add(player);
     card.RevealTo(Enumerable.Repeat(player, 1));
     if (player != Player.LocalPlayer)
     {
         Program.TracePlayerEvent(player, "{0} peeks at a card ({1}).", player,
           card.Group is Table ? "on table" : "in " + card.Group.FullName);
     }
 }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:11,代码来源:ClientHandler.cs

示例15: OnMarkerChanged_3_1_0_1

 public void OnMarkerChanged_3_1_0_1(Card card, string markerName, int oldValue, int newValue, bool isScriptChange)
 {
     if(Player.LocalPlayer.Spectator)return;
     if(MuteEvents)return;
     if(gameEngine.Definition.ScriptVersion != C_3_1_0_1 )
         return;
     var thisVersion = Version.Parse("3.1.0.1");
     dynamic args = new System.Dynamic.ExpandoObject();
     if(thisVersion >= BASEOBJECTVERSION)
     {
         args.card = card;
         args.markerName = markerName;
         args.oldValue = oldValue;
         args.newValue = newValue;
         args.isScriptChange = isScriptChange;
     }
     foreach(var e in eventCache["OnMarkerChanged"])
     {
         if(thisVersion < BASEOBJECTVERSION)
             engine.ExecuteFunction(e.PythonFunction,card, markerName, oldValue, newValue, isScriptChange);
         else
         {
             engine.ExecuteFunction(e.PythonFunction, args);
         }
     }
 }
开发者ID:octgn,项目名称:OCTGN,代码行数:26,代码来源:GameEvents.cs


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