本文整理汇总了C#中Turn类的典型用法代码示例。如果您正苦于以下问题:C# Turn类的具体用法?C# Turn怎么用?C# Turn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Turn类属于命名空间,在下文中一共展示了Turn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Connect4Board
public Connect4Board()
{
columns = new Connect4Column[COLUMNS];
for (int i = 0; i < columns.Length; i++)
columns[i] = new Connect4Column();
turn = Turn.NOT_IN_SESSION;
}
示例2: Category
public Category(string title, IRule rule, Turn turn, Dice dice)
{
Title = title;
_rule = rule;
_turn = turn;
_dice = dice;
}
示例3: AddTurn
public void AddTurn(Turn _turn)
{
if (m_trns == null) {
m_trns = new List<Turn> ();
}
m_trns.Add (_turn);
}
示例4: TurnCleanup
public void TurnCleanup() {
turn = new Turn();
currentEffects.Remove(StatusEffect.Confuse);
currentEffects.Remove(StatusEffect.Paralyse);
currentEffects.Remove(StatusEffect.Shield);
}
示例5: Start
void Start () {
runeBucket = new List<Rune>();
currentEffects = new List<StatusEffect>();
turn = new Turn();
animator = GetComponent<Animator>();
sprRend = GetComponent<SpriteRenderer>();
}
示例6: GoldRush
public GoldRush()
{
m_currentTurn = Turn.Start;
m_numbersLeft = new List<short>[3];
m_board = new short[Players, N];
for (int i = 0; i < Players; i++)
{
m_numbersLeft[i] = new List<short>();
}
for (short i = 1; i <= N; i++)
{
m_numbersLeft[User].Add(i);
m_numbersLeft[Opponent].Add(i);
m_numbersLeft[Computer].Add(i);
}
m_history = new Dictionary<string, List<short[]>>();
m_guaranteedPerson = new List<string>();
m_dateToPlayers = new Dictionary<DateTime, List<string>>();
m_isGuaranteedPerson = false;
m_joinDate = DateTime.MinValue;
Load();
// OptimalBet();
Go();
}
示例7: CheckForPairs
private static bool CheckForPairs(Turn thisGame)
{
var isPairs = false;
var firstValue = thisGame.CurrentDice[0].Value;
var quantityOfFirstValue = CountQuantityOfAValue(firstValue, thisGame);
var secondValue = firstValue;
var i = 0;
while (firstValue == secondValue && i < 6)
{
secondValue = thisGame.CurrentDice[i].Value;
i++;
}
var quantityOfSecondValue = CountQuantityOfAValue(secondValue, thisGame);
var thirdValue = firstValue;
var quantityOfThirdValue = 0;
i = 0;
while ((firstValue == thirdValue || secondValue == thirdValue) && i < 6)
{
thirdValue = thisGame.CurrentDice[i].Value;
i++;
}
if (i != 7)
quantityOfThirdValue = CountQuantityOfAValue(thirdValue, thisGame);
if (quantityOfFirstValue == 2 && quantityOfSecondValue == 2 && quantityOfThirdValue == 2)
isPairs = true;
return isPairs;
}
示例8: SetUp
public void SetUp()
{
_turn = Substitute.For<Turn>();
_dice = Substitute.For<Dice>();
_onesRule = Substitute.For<IRule>();
_category = new Category("Ones", _onesRule, _turn, _dice);
}
示例9: SetActionToFree
void SetActionToFree()
{
actionTurn = Turn.free;
if(FreeAction != null){
FreeAction();
}
}
示例10: BerzerkMovement
private static void BerzerkMovement(Turn gameLogTurn, int distance, Combatant active,
int speedNotFiring, int speedFiring, int direction, int enemyPos, int oldPos)
{
if (distance > 0)
{
// run to enemy!
gameLogTurn.Movement.Add(new Phase { Actor = active.Template, Message = active.Name + " runs towards the enemy in blind fury!", Relevance = Relevance.Medium, Icon = moveIcon});
var movement = speedNotFiring*direction;
int newPos = active.Position + (movement <= distance ? movement : distance);
if (newPos == enemyPos)
{
gameLogTurn.Movement.Add(new Phase { Actor = active.Template, Message = active.Name + " enters close combat!", Relevance = Relevance.High, Icon = chargeIcon });
active.Melee = true;
}
if (speedFiring <= Math.Abs(oldPos - newPos))
active.CanFire = true;
else
active.CanFire = false;
active.Position = newPos;
}
else
{
gameLogTurn.Movement.Add(new Phase { Actor = active.Template, Message = active.Name + " hurls himself into the melee!", Relevance = Relevance.Medium, Icon = chargeIcon });
active.CanFire = true;
}
}
示例11: ControlPage
public ControlPage()
{
this.InitializeComponent();
turn = Turn.none;
direction = Direction.none;
accelerometer = App.accelerometer;
bluetooth = App.bluetooth;
arduino = App.arduino;
if( accelerometer == null || bluetooth == null || arduino == null )
{
Frame.Navigate( typeof( MainPage ) );
return;
}
startButton.IsEnabled = true;
stopButton.IsEnabled = true;
disconnectButton.IsEnabled = true;
bluetooth.ConnectionLost += Bluetooth_ConnectionLost;
keepScreenOnRequest = new DisplayRequest();
keepScreenOnRequest.RequestActive();
App.arduino.pinMode( LR_DIRECTION_CONTROL_PIN, PinMode.OUTPUT );
App.arduino.pinMode( FB_DIRECTION_CONTROL_PIN, PinMode.OUTPUT );
App.arduino.pinMode( LR_MOTOR_CONTROL_PIN, PinMode.PWM );
App.arduino.pinMode( FB_MOTOR_CONTROL_PIN, PinMode.PWM );
App.arduino.pinMode(HEARTBEAT_LED_PIN, PinMode.OUTPUT);
}
示例12: ControlPageMaisto
public ControlPageMaisto()
{
this.InitializeComponent();
turn = Turn.none;
direction = Direction.none;
accelerometer = App.accelerometer;
bluetooth = App.bluetooth;
arduino = App.arduino;
if( accelerometer == null || bluetooth == null || arduino == null )
{
Frame.Navigate( typeof( MainPage ) );
return;
}
startButton.IsEnabled = true;
stopButton.IsEnabled = true;
disconnectButton.IsEnabled = true;
bluetooth.ConnectionLost += Bluetooth_ConnectionLost;
keepScreenOnRequest = new DisplayRequest();
keepScreenOnRequest.RequestActive();
App.arduino.pinMode( FORWARD_CONTROL_PIN, PinMode.OUTPUT );
App.arduino.pinMode( REVERSE_CONTROL_PIN, PinMode.OUTPUT );
App.arduino.pinMode( LEFT_CONTROL_PIN, PinMode.OUTPUT );
App.arduino.pinMode( RIGHT_CONTROL_PIN, PinMode.OUTPUT );
}
示例13: DefaultMoveExecutor
public DefaultMoveExecutor(string board, string newMove, Turn turn,
GameState gameState, string whiteKingPosition, string blackKingPosition, string lastMove,
bool whiteCanCastleKingSide, bool whiteCanCastleQueenSide, bool blackCanCastleKingSide,
bool blackCanCastleQueenSide)
{
FieldPosition whiteKing = FieldPosition.ParsePosition(whiteKingPosition);
FieldPosition blackKing = FieldPosition.ParsePosition(blackKingPosition);
this.oldState = new BoardModel(GetBoard(board), turn, gameState, whiteKing, blackKing,
whiteCanCastleKingSide, whiteCanCastleQueenSide, blackCanCastleKingSide, blackCanCastleQueenSide);
this.newState = new BoardModel(GetBoard(board), turn, gameState, whiteKing, blackKing,
whiteCanCastleKingSide, whiteCanCastleQueenSide, blackCanCastleKingSide, blackCanCastleQueenSide);
// Parse new move
string[] splt = newMove.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
this.source = FieldPosition.ParsePosition(splt[0]);
this.dest = FieldPosition.ParsePosition(splt[1]);
if (lastMove != null)
{
// Parse last move
splt = lastMove.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
this.lastMoveSource = FieldPosition.ParsePosition(splt[0]);
this.lastMoveDest = FieldPosition.ParsePosition(splt[1]);
}
this.sourcePiece = this.newState.Board[source.Row, source.Col];
}
示例14: ControlPage
public ControlPage()
{
this.InitializeComponent();
turn = Turn.none;
direction = Direction.none;
accelerometer = App.accelerometer;
bluetooth = App.bluetooth;
arduino = App.arduino;
if (accelerometer == null || bluetooth == null || arduino == null)
{
Frame.Navigate(typeof(MainPage));
return;
}
startButton.IsEnabled = true;
stopButton.IsEnabled = true;
disconnectButton.IsEnabled = true;
keepScreenOnRequest = new DisplayRequest();
keepScreenOnRequest.RequestActive();
App.arduino.pinMode(enableA, PinMode.OUTPUT);
App.arduino.pinMode(MotorA1, PinMode.OUTPUT);
App.arduino.pinMode(MotorA2, PinMode.OUTPUT);
App.arduino.pinMode(enableB, PinMode.OUTPUT);
App.arduino.pinMode(MotorB1, PinMode.OUTPUT);
App.arduino.pinMode(MotorB2, PinMode.OUTPUT);
arduino.digitalWrite(enableA, PinState.HIGH);
arduino.digitalWrite(enableB, PinState.HIGH);
}
示例15: GlobalBoardTurn
internal GlobalBoardTurn(Turn turn, Card draw)
{
PlayCard = turn.Card;
PlayIsDiscard = turn.Discard;
DrawCard = draw;
DrawLocation = turn.Draw;
}