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


C# Card.AddMarker方法代码示例

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


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

示例1: 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

示例2: 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

示例3: TransferMarker

        public void TransferMarker(Player player, Card from, Card to, Guid id, string name, ushort count)
        {
            // Ignore markers moved by oneself (already moved for responsiveness issues)
            if (player != Player.LocalPlayer)
            {
                Marker marker = from.FindMarker(id, name);
                if (marker == null)
                {
                    Program.Trace.TraceEvent(TraceEventType.Warning, EventIds.NonGame, "Inconsistent state. Marker not found on card.");
                    return;
                }
                if (marker.Count < count)
                    Program.Trace.TraceEvent(TraceEventType.Warning, EventIds.NonGame, "Inconsistent state. Missing markers to remove");

                from.RemoveMarker(marker, count);
                to.AddMarker(marker.Model, count);
            }
            Program.Trace.TraceEvent(TraceEventType.Information, EventIds.Event | EventIds.PlayerFlag(player), "{0} moves {1} {2} marker(s) from {3} to {4}", player, count, name, from, to);
        }
开发者ID:Kamalisk,项目名称:OCTGN,代码行数:19,代码来源:ClientHandler.cs

示例4: TransferMarker

 public void TransferMarker(Player player, Card from, Card to, Guid id, string name, ushort count, ushort oldCount, bool isScriptChange)
 {
     Marker marker = from.FindMarker(id, name);
     if (player == null)
     {
         Program.GameMess.Warning("Inconsistent state. Cannot transfer marker to unknown player.");
         return;
     }
     if (player != Player.LocalPlayer)
     {
         if (marker == null)
         {
             Program.GameMess.Warning("Inconsistent state. Marker not found on card.");
             return;
         }
         if (marker.Count != oldCount)
             Program.GameMess.Warning("Inconsistent state. Missing markers to remove");
     }
     Marker newMarker = to.FindMarker(id, name);
     int toOldCount = 0;
     if (newMarker != null)
         toOldCount = newMarker.Count - 1;
     int fromNewCount = oldCount - count;
     int toNewCount = toOldCount + count;
     if (player != Player.LocalPlayer)
     {
         from.RemoveMarker(marker, count);
         to.AddMarker(marker.Model, count);
     }
     Program.GameMess.PlayerEvent(player, "moves {0} {1} marker(s) from {2} to {3}", count, name, from, to);
     if (marker == null)
     {
         marker = from.FindRemovedMarker(id, name);
     }
     if (marker != null)
     {
         if (isScriptChange == false)
         {
             Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_0(
                 from,
                 marker.Model.ModelString(),
                 oldCount,
                 fromNewCount,
                 isScriptChange);
             Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_0(
                 to,
                 marker.Model.ModelString(),
                 toOldCount,
                 toNewCount,
                 isScriptChange);
             Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_1(
                 from,
                 marker.Model.ModelString(),
                 oldCount,
                 fromNewCount,
                 isScriptChange);
             Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_1(
                 to,
                 marker.Model.ModelString(),
                 toOldCount,
                 toNewCount,
                 isScriptChange);
         }
         Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_2(
             from,
             marker.Model.Name,
             marker.Model.Id.ToString(),
             oldCount,
             isScriptChange);
         Program.GameEngine.EventProxy.OnMarkerChanged_3_1_0_2(
             to,
             marker.Model.Name,
             marker.Model.Id.ToString(),
             toOldCount,
             isScriptChange);
     }
 }
开发者ID:rexperalta,项目名称:OCTGN,代码行数:77,代码来源:ClientHandler.cs


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