• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GameAction类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GameAction的典型用法代码示例。如果您正苦于以下问题:C# GameAction类的具体用法?C# GameAction怎么用?C# GameAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GameAction类属于命名空间,在下文中一共展示了GameAction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: Process

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

            var mapPicture = GetMapPicture(Dungeon);

            painter.DrawMap(mapPicture);
            painter.DrawMessage(Message);

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


示例17: PickAction

 public PickAction(GameAction[] p_actions, int[] p_chances, int[] p_delays)
 {
     this.actions = new GameAction[p_actions.Length];
     this.chances = new int[p_chances.Length];
     this.delays = new int[p_chances.Length];
     for (int i = 0; i < p_actions.Length; i++)
     {
         this.actions[i] = p_actions[i];
         this.chances[i] = p_chances[i];
         this.delays[i] = p_delays[i];
     }
 }
开发者ID:maestun,项目名称:wonderboy,代码行数:12,代码来源:PickAction.cs


示例18: InvalidOperationException

        GamePosition IGameRunner.Step(GamePosition currentPosition, GameAction gameAction)
        {
            Contract.Requires<ArgumentNullException>(currentPosition != null);
            Contract.Requires<ArgumentNullException>(gameAction != null);

            Contract.Ensures(Contract.Result<GamePosition>() != null);
            Contract.Ensures(Contract.Result<GamePosition>().FirstTeamPosition != null);
            Contract.Ensures(Contract.Result<GamePosition>().FirstTeamPosition.Count() == currentPosition.FirstTeamPosition.Count());
            Contract.Ensures(Contract.Result<GamePosition>().SecondTeamPosition != null);
            Contract.Ensures(Contract.Result<GamePosition>().SecondTeamPosition.Count() == currentPosition.SecondTeamPosition.Count());

            throw new InvalidOperationException();
        }
开发者ID:AlexanderElyseev,项目名称:Football,代码行数:13,代码来源:GameRunnerContract.cs


示例19: ActionWithBall

        /* The keeper will shoot to the unmarked player who is the closest to the enemy's goal. */
        public override PlayerAction ActionWithBall(Player player, GameAction gameAction)
        {
            if (RoundsWithBall < 5)
            {
                RoundsWithBall++;
                return null;
            }
            else
            {
                /* Sets the middle point of the enemy's goal as the target point*/
                Point targetPoint = GameAI.GetEnemyTeam(GameAI.PlayersTeam(player)).TeamGoal.MiddlePoint;
                /* Searches the nearest unmarked player to the target point */
                Player unmarkedPlayer = SearchPassPlayers(player).ElementAt(0);

                return new PlayerAction(unmarkedPlayer, unmarkedPlayer.Location, ActionType.Pass);
            }
        }
开发者ID:Jecral,项目名称:Football,代码行数:18,代码来源:GoalkeeperAI.cs


示例20: GameDataAction

        public GameDataAction(string actionString)
        {
            Data = new Dictionary<string, GameData>();

            var start = actionString.IndexOf(':');
            var enumString = actionString.Substring(0, start);
            Action = (GameAction) Enum.Parse(typeof (GameAction), enumString);

            var i = start;

            while (++i < actionString.Length)
            {
                if (actionString[i] != '[') continue;
                i++;
                var param = GetString(actionString, ref i);
                if (actionString[i] != ':')
                    throw new FormatException($"Was expecting ':' @ {i}, found '{actionString[i]}' instead.");
                i++;
                if (actionString[i] == '\'')
                {
                    Data.Add(param, GetString(actionString, ref i));
                }
                else if (char.IsDigit(actionString[i]) || actionString[i] == '-' || actionString[i] == '.')
                {
                    var numStart = i;
                    while (actionString[++i] != ']') ;
                    var sub = actionString.Substring(numStart, i - numStart);
                    if (sub.EndsWith("f"))
                    {
                        Data.Add(param,
                            float.Parse(sub.Substring(0, sub.Length - 1),
                                NumberStyles.Float | NumberStyles.AllowThousands));
                    }
                    else if (sub.Contains("."))
                    {
                        Data.Add(param, double.Parse(sub, NumberStyles.Float | NumberStyles.AllowThousands));
                    }
                    else
                    {
                        Data.Add(param, int.Parse(sub, NumberStyles.Integer));
                    }
                }
            }
        }
开发者ID:elliotharris,项目名称:Card-Game-Server,代码行数:44,代码来源:GameDataAction.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GameBitBuffer类代码示例发布时间:2022-05-24
下一篇:
C# Game1类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap