本文整理汇总了C#中GameAction类的典型用法代码示例。如果您正苦于以下问题:C# GameAction类的具体用法?C# GameAction怎么用?C# GameAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GameAction类属于命名空间,在下文中一共展示了GameAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultiAction
public MultiAction(GameAction p_action, int p_count, int p_delay)
{
this.action = p_action;
this.count = p_count;
this.delay = p_delay;
this.waiting = false;
}
示例2: validate
public override bool validate( GameAction gameAction )
{
PieceSelection selectionAction = (PieceSelection)gameAction;
// Verify that the selected piece belongs to player on turn
return selectionAction.belongsToAttacker == Game.currentPlayer.isAttackerPlayer ;
}
示例3: TagAndNotify
public override void TagAndNotify(Player source, List<Player> dests, ICard card, GameAction action = GameAction.Use)
{
if (this.IsReforging(source, null, null, dests))
{
if (card is CompositeCard)
{
foreach (Card c in (card as CompositeCard).Subcards)
{
c.Log.Source = source;
c.Log.GameAction = GameAction.Reforge;
}
}
else
{
var c = card as Card;
Trace.Assert(card != null);
c.Log.Source = source;
c.Log.GameAction = GameAction.Reforge;
}
Game.CurrentGame.NotificationProxy.NotifyReforge(source, card);
return;
}
base.TagAndNotify(source, dests, card, action);
}
示例4: ActionWithoutBall
/* The keeper will move to a new position depending on the ball's position and direction. */
public override PlayerAction ActionWithoutBall(Player player, GameAction gameAction)
{
Pathfinding pathfinding = new Pathfinding();
Point ballTarget = GameAI.BallNextRoundLocation();
bool onOwnSide = GameAI.IsPointOnOwnSide(GameAI.PlayersTeam(player), ballTarget);
if (onOwnSide)
{
if (GameAI.GameBall.IsInShootState)
{
Point ballTargetGridLocation = pathfinding.GetGridLocation(GameAI.GameBall.ExactTargetLocation);
Goal ownGoal = GameAI.PlayersTeam(player).TeamGoal;
Point? pointBeforeGoalEntry = GameAI.PointBeforeRectangleEntry(ownGoal.GoalRectangle);
//true if the ball will go through the goal
if (pointBeforeGoalEntry.HasValue)
{
return GoalKeeperShootDefense(player, pointBeforeGoalEntry.Value);
}
}
else
{
return GoalKeeperPassDefense(player, ballTarget);
}
}
return null;
}
示例5: SendAction
public void SendAction(GameAction gameAction, Dictionary<string, GameData> data)
{
var sb = new StringBuilder();
sb.Append((int) gameAction);
if (data != null)
{
sb.Append(":");
foreach (var d in data)
{
var valueStr = d.Value.String();
if (d.Value.Type == GameDataType.String)
{
valueStr = "'" + valueStr + "'";
}
sb.Append($"['{d.Key}':{valueStr}]");
}
}
sb.Append(";\n");
Console.WriteLine(sb);
_dataWriter.Write(sb.ToString());
_dataWriter.Flush();
}
示例6: SkeletonAction
public SkeletonAction(GameAction p_jump)
{
this.jump = p_jump;
this.reverse = new Reverse();
this.facePlayer = new FacePlayer();
this.wait = new Wait(120);
}
示例7: HandleAction
private void HandleAction(GameAction action)
{
TryHandlePlayCardAction(action);
TryHandleAttackAction(action);
TryHandleDeathAction(action);
TryHandleShowEntity(action);
TryHandleOtherAction(action);
}
示例8: ProcessSubAction
public ProcessResult ProcessSubAction(GameAction action)
{
var actionResult = ProcessAction(action);
painter.DrawMessage(Message);
return actionResult;
}
示例9: PushActionPool
static public void PushActionPool(int actionId, GameAction action)
{
RemoveActionPool(actionId);
SocketPackage package = new SocketPackage();
package.ActionId = actionId;
package.Action = action;
ActionPools.Add(package);
}
示例10: Next
void Next () {
if (queue.Count < 1) {
return;
}
currentAction = (GameAction)queue.Dequeue();
currentAction.behaviour.SendMessage(currentAction.methodName,
SendMessageOptions.RequireReceiver);
}
示例11: SetUpInput
public void SetUpInput()
{
GameAction timeTravel = new GameAction(
this, this.GetType().GetMethod("TimeTravel"),
new object[0]);
InputManager.AddToKeyboardMap(Keys.X, timeTravel);
InputManager.AddToButtonsMap(Buttons.X, timeTravel);
}
示例12: Update
public override bool Update(GameAction action, object p1, object p2)
{
if ((int)p1 == 1)
{
killcount += (int)p2;
return killcount <= maxkill;
}
return false;
}
示例13: DataTransfer
public DataTransfer(CardIdentifier _cardID, GameAction _gameAction, int _other1, int _other2, int _other3, string _str1)
{
cardID = _cardID;
gameAction = _gameAction;
other1 = _other1;
other2 = _other2;
other3 = _other3;
str1 = _str1;
}
示例14: validate
public override bool validate( GameAction gameAction )
{
PieceMove moveAction = (PieceMove)gameAction;
SquareState destinationState = Game.board [(int)moveAction.squareIndex.y,
(int)moveAction.squareIndex.x].state;
// Verify that the selected square is a valid destination for the selected piece
return destinationState == SquareState.VALID ||
destinationState == SquareState.VALID_TRACED;
}
示例15: performAction
public override void performAction( GameAction gameAction )
{
if( currentPlayer.Equals(player2) ) // currentPlayer == player2 turn
gameAction.execute ();
else if (gameAction.validate ())
{
BManager.sendGameMessage(gameAction.getMessage());
gameAction.execute ();
}
else audio.playError ();
}