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


C# Play.Player类代码示例

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


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

 public RandomRequest(Player player, int id, int min, int max)
 {
     _player = player;
     Id = id;
     _min = min;
     _max = max;
 }
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:7,代码来源:RandomRequest.cs

示例3: Counter

        private int _state; // Value of this counter

        #endregion Fields

        #region Constructors

        public Counter(Player player, DataNew.Entities.Counter def)
        {
            _player = player;
            _state = def.Start;
            _name = def.Name;
            _id = def.Id;
            _defintion = def;
        }
开发者ID:Gravecorp,项目名称:OCTGN,代码行数:14,代码来源:Counter.cs

示例4: Card

 internal Card(Player owner, int id, ulong key, Definitions.CardDef def, Data.CardModel model, bool mySecret)
     : base(owner)
 {
     this.id = id;
       this.Type = new CardIdentity(id) { alias = false, key = key, model = model, mySecret = mySecret };
       definition = def;
       All.Add(id, this);
 }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:8,代码来源:Card.cs

示例5: Reset

 // Resets the lPlayer list
 internal static void Reset()
 {
     lock (all)
     {
         all.Clear();
         spectators.Clear();
         LocalPlayer = GlobalPlayer = null;
     }
 }
开发者ID:rexperalta,项目名称:OCTGN,代码行数:10,代码来源:Player.cs

示例6: Card

 internal Card(Player owner, int id, ulong key, CardDef def, DataNew.Entities.Card model, bool mySecret)
     : base(owner)
 {
     _id = id;
     Type = new CardIdentity(id) {Alias = false, Key = key, Model = model, MySecret = mySecret};
     // var _definition = def;
     All.Add(id, this);
     _alternateOf = null;
     numberOfSwitchWithAlternatesNotPerformed = 0;
     _isAlternateImage = false;
 }
开发者ID:voidbeast,项目名称:OCTGN,代码行数:11,代码来源:Card.cs

示例7: AddAnswer2

 public void AddAnswer2(Player player, ulong decrypted)
 {
     foreach (var v in values)
         if (v.player == player)
         {
             v.decrypted = decrypted;
             v.CheckConsistency();
             phase2Count++;
             return;
         }
     Program.Trace.TraceEvent(TraceEventType.Warning, EventIds.Event, "[AddAnswer] Protocol inconsistency. One client is buggy or tries to cheat.");
 }
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:12,代码来源:RandomRequest.cs

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

示例9: AddAnswer2

 public void AddAnswer2(Player lPlayer, ulong decrypted)
 {
     foreach (RandomValue v in _values.Where(v => v.Player == lPlayer))
     {
         v.Decrypted = decrypted;
         v.CheckConsistency();
         _phase2Count++;
         return;
     }
     Program.Trace.TraceEvent(TraceEventType.Warning, EventIds.Event,
                              "[AddAnswer] Protocol inconsistency. One client is buggy or tries to cheat.");
 }
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:12,代码来源:RandomRequest.cs

示例10: OnEndTurn

        public void OnEndTurn(Player player)
        {
            var args = new object[1];
            args[0] = player;

            if(Program.GameEngine.Definition.Events.ContainsKey("OnEndTurn"))
            {
                foreach(var e in Program.GameEngine.Definition.Events["OnEndTurn"])
                {
                    engine.ExecuteFunction(e.PythonFunction,player);
                }
              	}
        }
开发者ID:haslo,项目名称:OCTGN,代码行数:13,代码来源:GameEvents.cs

示例11: OnChangeCounter

        public void OnChangeCounter(Player player, Counter counter, int oldValue)
        {
            var args = new object[3];
            args[0] = player;
            args[1] = counter;
            args[2] = oldValue;

            if(Program.GameEngine.Definition.Events.ContainsKey("OnChangeCounter"))
            {
                foreach(var e in Program.GameEngine.Definition.Events["OnChangeCounter"])
                {
                    engine.ExecuteFunction(e.PythonFunction,player, counter, oldValue);
                }
              	}
        }
开发者ID:haslo,项目名称:OCTGN,代码行数:15,代码来源:GameEvents.cs

示例12: OnEndTurn

        public void OnEndTurn(Player player)
        {
            Log.Info("Firing event OnEndTurn");
            var args = new object[1];
            args[0] = player;

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

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

示例14: Boot

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

示例15: AddPacks

 public void AddPacks(Player player, Guid[] packs, bool selfOnly)
 {
     var wnd = (Play.Dialogs.PickCardsDialog)WindowManager.PlayWindow.backstage.Child;
     string packNames = wnd.PackNames(packs);
     if (packNames == "") return;
     if (selfOnly && player != Player.LocalPlayer)
     {
         Program.TracePlayerEvent(player, "{0} added {1} to their pool.", player, packNames);
     }
     else if (selfOnly && player == Player.LocalPlayer)
     {
         Program.TracePlayerEvent(player, "{0} added {1} to their pool.", player, packNames);
         wnd.OpenPacks(packs);
     }
     else
     {
         Program.TracePlayerEvent(player, "{0} added {1} to the limited game for all players.", player, packNames);
         wnd.OpenPacks(packs);
     }
 }
开发者ID:sbarnabas,项目名称:OCTGN,代码行数:20,代码来源:ClientHandler.cs


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