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


C# GameAction类代码示例

本文整理汇总了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;
 }
开发者ID:maestun,项目名称:wonderboy,代码行数:7,代码来源:MultiAction.cs

示例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 ;
    }
开发者ID:sergiohc101,项目名称:Hnefatafl-AR,代码行数:7,代码来源:PieceSelectionValidation.cs

示例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);
        }
开发者ID:RagingBigFemaleBird,项目名称:sgs,代码行数:25,代码来源:TieSuoLianHuan.cs

示例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;
        }
开发者ID:Jecral,项目名称:Football,代码行数:30,代码来源:GoalkeeperAI.cs

示例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();
        }
开发者ID:elliotharris,项目名称:Card-Game-Server,代码行数:26,代码来源:GameActionWriter.cs

示例6: SkeletonAction

 public SkeletonAction(GameAction p_jump)
 {
     this.jump = p_jump;
     this.reverse = new Reverse();
     this.facePlayer = new FacePlayer();
     this.wait = new Wait(120);
 }
开发者ID:maestun,项目名称:wonderboy,代码行数:7,代码来源:SkeletonAction.cs

示例7: HandleAction

 private void HandleAction(GameAction action)
 {
     TryHandlePlayCardAction(action);
     TryHandleAttackAction(action);
     TryHandleDeathAction(action);
     TryHandleShowEntity(action);
     TryHandleOtherAction(action);
 }
开发者ID:boolex,项目名称:HSRecord,代码行数:8,代码来源:Parser.cs

示例8: ProcessSubAction

        public ProcessResult ProcessSubAction(GameAction action)
        {
            var actionResult = ProcessAction(action);

            painter.DrawMessage(Message);

            return actionResult;
        }
开发者ID:CatSkald,项目名称:Roguelike,代码行数:8,代码来源:Processor.cs

示例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);
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:8,代码来源:SocketConnect.cs

示例10: Next

	void Next () {
		if (queue.Count < 1) {
			return;
		}
		currentAction = (GameAction)queue.Dequeue();
		currentAction.behaviour.SendMessage(currentAction.methodName, 
		                                    SendMessageOptions.RequireReceiver);
	}
开发者ID:britg,项目名称:Troped,代码行数:8,代码来源:ActionQueue.cs

示例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);
        }
开发者ID:Infinity-S,项目名称:Nebula-Game,代码行数:9,代码来源:TimeTravelManager.cs

示例12: Update

 public override bool Update(GameAction action, object p1, object p2)
 {
     if ((int)p1 == 1)
     {
         killcount += (int)p2;
         return killcount <= maxkill;
     }
     return false;
 }
开发者ID:secondage,项目名称:projXdemo_wp7,代码行数:9,代码来源:Quest_quest1.cs

示例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;
 }
开发者ID:Javierudec,项目名称:VGOnline_Scripts,代码行数:9,代码来源:DataTransfer.cs

示例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;
    }
开发者ID:sergiohc101,项目名称:Hnefatafl-AR,代码行数:10,代码来源:PieceMoveValidation.cs

示例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 ();
 }
开发者ID:sergiohc101,项目名称:Hnefatafl-AR,代码行数:11,代码来源:NetworkGame.cs


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