本文整理汇总了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);
}
}
}
示例2: RandomRequest
public RandomRequest(Player player, int id, int min, int max)
{
_player = player;
Id = id;
_min = min;
_max = max;
}
示例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;
}
示例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);
}
示例5: Reset
// Resets the lPlayer list
internal static void Reset()
{
lock (all)
{
all.Clear();
spectators.Clear();
LocalPlayer = GlobalPlayer = null;
}
}
示例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;
}
示例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.");
}
示例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);
}
示例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.");
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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());
}
示例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());
}
示例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);
}
}