本文整理汇总了C#中CardOrientation类的典型用法代码示例。如果您正苦于以下问题:C# CardOrientation类的具体用法?C# CardOrientation怎么用?C# CardOrientation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CardOrientation类属于命名空间,在下文中一共展示了CardOrientation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Card
public Card( int rank, CardSuit suit, CardOrientation orientation = CardOrientation.FaceDown )
{
if ( rank < (int)CardRank.Ace || rank > (int)CardRank.King )
{
throw new ArgumentException( "Invalid card rank" );
}
InitCard( (CardRank) rank, suit, orientation );
}
开发者ID:arudnitsky,项目名称:Solitaire,代码行数:8,代码来源:Card.cs
示例2: RotateReq
public void RotateReq(int card, CardOrientation rot)
{
broadcaster.Rotate(clients[sender].id, card, rot);
}
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:4,代码来源:Handler.cs
示例3: SetOrientation
internal void SetOrientation(CardOrientation value)
{
if (value == _rot) return;
_rot = value;
OnPropertyChanged("Orientation");
}
开发者ID:voidbeast,项目名称:OCTGN,代码行数:6,代码来源:Card.cs
示例4: RotateReq
public void RotateReq(Card card, CardOrientation rot)
{
//Log.Info("[ProtOut] RotateReq");
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)46);
writer.Write(card.Id);
writer.Write((byte)rot);
writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
writer.Write((int)stream.Length);
writer.Close();
Send(stream.ToArray());
}
开发者ID:rexperalta,项目名称:OCTGN,代码行数:20,代码来源:BinaryStubs.cs
示例5: RotateReq
public void RotateReq(int card, CardOrientation rot)
{
_broadcaster.Rotate(_clients[_sender].Id, card, rot);
}
开发者ID:saturnattack,项目名称:OCTGN,代码行数:4,代码来源:Handler.cs
示例6: RotateReq
public void RotateReq(Card card, CardOrientation rot)
{
var sb = new StringBuilder();
XmlWriter writer = XmlWriter.Create(sb, XmlSettings);
writer.WriteStartElement("RotateReq");
if (Program.Client.Muted != 0)
writer.WriteAttributeString("muted", Program.Client.Muted.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("card", card.Id.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("rot", rot.ToString());
writer.WriteEndElement();
writer.Close();
Send(sb.ToString());
}
开发者ID:0M3G4,项目名称:OCTGN,代码行数:14,代码来源:XmlStubs.cs
示例7: 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
示例8: Rotate
public void Rotate(byte player, int card, CardOrientation rot)
{
if (xml != null)
xml.Rotate(player, card, rot);
if (bin != null)
bin.Rotate(player, card, rot);
Send();
}
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:8,代码来源:Broadcaster.cs
示例9: SetOrientation
internal void SetOrientation(CardOrientation value)
{
if(value != rot)
{
rot = value;
OnPropertyChanged("Orientation");
}
}
开发者ID:YoshiEnVerde,项目名称:OCTGN,代码行数:8,代码来源:Card.cs
示例10: InitCard
private void InitCard( CardRank rank, CardSuit suit, CardOrientation orientation )
{
Orientation = orientation;
Rank = rank;
Suit = suit;
if ( Suit == CardSuit.Hearts || Suit == CardSuit.Diamonds )
{
Color = CardColor.Red;
}
else
{
Color = CardColor.Black;
}
}
开发者ID:arudnitsky,项目名称:Solitaire,代码行数:14,代码来源:Card.cs
示例11: Rotate
public Rotate(Player who, Card card, CardOrientation rot)
{
this.who = who; this.card = card; this.rot = rot;
oldRot = card.Orientation;
}
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:5,代码来源:Rotate.cs
示例12: RotateReq
public void RotateReq(Card card, CardOrientation rot)
{
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)50);
writer.Write(card.Id);
writer.Write((byte)rot);
writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
writer.Write((int)stream.Length);
writer.Close();
Send(stream.ToArray());
}
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:20,代码来源:BinaryStubs.cs
示例13: Rotate
public Rotate(Player who, Card card, CardOrientation rot)
{
_who = who;
_card = card;
_rot = rot;
}
开发者ID:rexperalta,项目名称:OCTGN,代码行数:6,代码来源:Rotate.cs
示例14: RotateReq
public void RotateReq(int card, CardOrientation rot)
{
_broadcaster.Rotate(State.Instance.GetPlayer(_sender).Id, card, rot);
}
开发者ID:Keterr,项目名称:OCTGN,代码行数:4,代码来源:Handler.cs
示例15: Rotate
public void Rotate(byte player, int card, CardOrientation rot)
{
StringBuilder sb = new StringBuilder();
XmlWriter writer = XmlWriter.Create(sb, xmlSettings);
writer.WriteStartElement("Rotate");
if (handler.muted != 0)
writer.WriteAttributeString("muted", handler.muted.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("player", player.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("card", card.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("rot", rot.ToString());
writer.WriteEndElement();
writer.Close();
Send(sb.ToString());
}
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:15,代码来源:XmlStubs.cs
示例16: Rotate
public void Rotate(byte player, int card, CardOrientation rot)
{
MemoryStream stream = new MemoryStream(512);
stream.Seek(4, SeekOrigin.Begin);
BinaryWriter writer = new BinaryWriter(stream);
writer.Write(handler.muted);
writer.Write((byte)51);
writer.Write(player);
writer.Write(card);
writer.Write((byte)rot);
writer.Flush(); writer.Seek(0, SeekOrigin.Begin);
writer.Write((int)stream.Length);
writer.Close();
Send(stream.ToArray());
}
开发者ID:Entropy42,项目名称:OCTGN,代码行数:16,代码来源:BinaryStubs.cs
示例17: RotateReq
public void RotateReq(Card card, CardOrientation rot)
{
StringBuilder sb = new StringBuilder();
XmlWriter writer = XmlWriter.Create(sb, xmlSettings);
writer.WriteStartElement("RotateReq");
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("card", card.Id.ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("rot", rot.ToString());
writer.WriteEndElement();
writer.Close();
Send(sb.ToString());
}
开发者ID:kellyelton,项目名称:octgnwlobby,代码行数:16,代码来源:XmlStubs.cs
示例18: Rotate
public void Rotate(byte player, int card, CardOrientation rot)
{
bin.Rotate(player, card, rot);
Send();
}
开发者ID:rexperalta,项目名称:OCTGN,代码行数:5,代码来源:Broadcaster.cs
示例19: CardDragAdorner
//fix MAINWINDOW bug
public CardDragAdorner(CardControl anchor, CardControl sourceCard, Vector mousePoint)
: base(Program.PlayWindow.Content as UIElement)
{
SourceCard = sourceCard;
bool isCardInverted = anchor.IsOnTableCanvas && (Player.LocalPlayer.InvertedTable ^ anchor.IsInverted);
Point cardOrigin;
if (isCardInverted)
{
CardDef cardDef = Program.Game.Definition.CardDefinition;
cardOrigin = new Point(cardDef.Width, cardDef.Height);
_mouseOffset = new Vector(cardDef.Width - mousePoint.X, cardDef.Height - mousePoint.Y);
}
else
{
cardOrigin = new Point();
_mouseOffset = mousePoint;
}
//fix MAINWINDOW bug
_basePt = anchor.TranslatePoint(cardOrigin, Program.PlayWindow.Content as UIElement);
_faceUp = sourceCard.IsAlwaysUp || sourceCard.Card.FaceUp;
_lightRedBrush = Brushes.Red.Clone();
_faceDownBrush = new ImageBrush(sourceCard.Card.GetBitmapImage(false));
_faceUpBrush = _faceUp
? new VisualBrush(sourceCard.GetCardVisual())
{
Viewbox = new Rect(0, 0, sourceCard.ActualWidth, sourceCard.ActualHeight),
ViewboxUnits = BrushMappingMode.Absolute
}
: (Brush)
new ImageBrush(new BitmapImage(new Uri(Program.Game.Definition.CardDefinition.Front)));
_invertTransform = new ScaleTransform {CenterX = 0.5, CenterY = 0.5};
_faceUpBrush.RelativeTransform = _invertTransform;
if (_faceUpBrush is VisualBrush)
RenderOptions.SetCachingHint(_faceUpBrush, CachingHint.Cache);
_child.BeginInit();
_child.Width = anchor.ActualWidth*CardControl.ScaleFactor.Width;
_child.Height = anchor.ActualHeight*CardControl.ScaleFactor.Height;
_child.Fill = _faceUp ? _faceUpBrush : _faceDownBrush;
_child.StrokeThickness = 3;
var transforms = new TransformGroup();
_child.RenderTransform = transforms;
_rot = sourceCard.Card.Orientation;
if ((_rot & CardOrientation.Rot180) != 0)
{
_rot180Transform = new RotateTransform(180, _child.Width/2, _child.Height/2);
transforms.Children.Add(_rot180Transform);
}
if ((_rot & CardOrientation.Rot90) != 0)
{
_rot90Transform = isCardInverted
? new RotateTransform(90, _child.Width/2, _child.Width/2)
: new RotateTransform(90, _child.Width/2, _child.Height - _child.Width/2);
transforms.Children.Add(_rot90Transform);
}
_translate = new TranslateTransform();
transforms.Children.Add(_translate);
_child.IsHitTestVisible = false;
_child.EndInit();
AddVisualChild(_child);
var animation = new DoubleAnimation(0.55, 0.75, new Duration(TimeSpan.FromMilliseconds(500)))
{AutoReverse = true, RepeatBehavior = RepeatBehavior.Forever};
animation.Freeze();
_faceUpBrush.BeginAnimation(Brush.OpacityProperty, animation);
_faceDownBrush.BeginAnimation(Brush.OpacityProperty, animation);
_lightRedBrush.BeginAnimation(Brush.OpacityProperty, animation);
}
开发者ID:BastienDurel,项目名称:OCTGN,代码行数:73,代码来源:CardDragAdorner.cs
示例20: AnimateOrientation
private void AnimateOrientation(CardOrientation newOrientation)
{
double target90 = (newOrientation & CardOrientation.Rot90) != 0 ? 90 : 0;
double target180 = (newOrientation & CardOrientation.Rot180) != 0 ? 180 : 0;
if (Math.Abs(target90 - rotate90.Angle) > double.Epsilon)
{
var anim = new DoubleAnimation(target90, TimeSpan.FromMilliseconds(300), FillBehavior.HoldEnd)
{EasingFunction = new ExponentialEase()};
rotate90.BeginAnimation(RotateTransform.AngleProperty, anim);
}
if (Math.Abs(target180 - rotate180.Angle) <= double.Epsilon) return;
var animation = new DoubleAnimation(target180, TimeSpan.FromMilliseconds(600), FillBehavior.HoldEnd)
{EasingFunction = new ExponentialEase()};
rotate180.BeginAnimation(RotateTransform.AngleProperty, animation);
}
开发者ID:pakoito,项目名称:OCTGN,代码行数:15,代码来源:CardControl.xaml.cs
注:本文中的CardOrientation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论