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


C# GameInfo.CreateMessage方法代码示例

本文整理汇总了C#中GameInfo.CreateMessage方法的典型用法代码示例。如果您正苦于以下问题:C# GameInfo.CreateMessage方法的具体用法?C# GameInfo.CreateMessage怎么用?C# GameInfo.CreateMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GameInfo的用法示例。


在下文中一共展示了GameInfo.CreateMessage方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CleanUp

 private static void CleanUp(Node node, Vector2 location, GameInfo gameInfo)
 {
     gameInfo.CreateMessage(String.Empty);
     gameInfo.ClearTargets();
     foreach (var possibleNode in _possibleNodes) {
         possibleNode.RememberColorState(ColorState.None);
         possibleNode.SetColorState(ColorState.None);
         possibleNode.ListenMouseDown -= _cleanupCallback;
         possibleNode.ListenMouseDown -= _callback;
     }
 }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:11,代码来源:ChoosePathHelper.cs

示例2: PerformLogic

        public IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo)
        {
            // Increase the age
            bool endWorld = gameInfo.IncreaseAgeCounter();

            var waitState = StateFactory.GetState(GameStates.Wait);
            var alert = new Alert(gameInfo.Manager, "You just spun a 10!\nThe world age increases!\n" + (endWorld ? "Retirement Age Reached!" : String.Empty),
                "World age increased",
                icon : Constants.ImageIcons.SpinToWin);
            gameInfo.Manager.Add(alert);
            alert.Closed += (sender, args) => gameInfo.Fsm.Remove(waitState);

            gameInfo.CreateMessage(endWorld ? "Retirement Age Reached!" : "The world age counter increases by 10!");
            return endWorld ? new[] { waitState, StateFactory.GetState(GameStates.EndGame) } : new[] { waitState };
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:15,代码来源:IncreaseAgeCounter.cs

示例3: TravelToNodes

        public static void TravelToNodes(List<Node> possibleNodes, GameInfo gameInfo, MouseDown<Node> callback, bool createCameratTargets = true)
        {
            gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
            gameInfo.CreateMessage("Choose your destination!");
            _cleanupCallback = (node, location) => CleanUp(node, location, gameInfo);
            _callback = callback;
            _possibleNodes = possibleNodes;
            foreach (var possibleNode in possibleNodes) {
                possibleNode.RememberColorState(ColorState.Glow);
                possibleNode.SetColorState(ColorState.Glow);
                possibleNode.ListenMouseDown += callback;
                possibleNode.ListenMouseDown += _cleanupCallback;
                if (createCameratTargets) {
                    gameInfo.AddLowPriorityTarget(possibleNode);
                }

            }
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:18,代码来源:ChoosePathHelper.cs

示例4: PerformLogic

        public IGameState[] PerformLogic(GameTime gameTime, GameInfo gameInfo)
        {
            var waitState = StateFactory.GetState(GameStates.Wait);
            var alert = new Alert(gameInfo.Manager,
                "You have just spun a 1!\n" +
                "The world will now begin to change!\n\n" +
                "This will affect both house prices\n" +
                "And the logic in the world tiles!\n",
                "The world is going to change!", icon: Constants.ImageIcons.SpinToWin);
            gameInfo.Manager.Add(alert);
            alert.Closed += (sender, args) => gameInfo.Fsm.Remove(waitState);
            gameInfo.CreateMessage("The world is changing!");

            return new[] {
                    new FadeInWorld(_changeableNode.Concat(_houseNodes).Cast<WorldObject>().ToList()),
                    new ChangeWorldLogic(_changeableNode, _houseNodes),
                    new FadeOutWorld(_changeableNode.Concat(_houseNodes).Cast<WorldObject>().ToList()),
                    waitState
                };
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:20,代码来源:ChangeWorldLogic.cs

示例5: TakeExamLogic

 private IGameState[] TakeExamLogic(GameInfo gameInfo)
 {
     gameInfo.CreateMessage("Time for your exam! Spin the spinner!");
     gameInfo.PanCameraToObject(gameInfo.Spinner);
     return new[] { this, StateFactory.GetState(GameStates.GameStates.Spin) };
 }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:6,代码来源:TakeExam.cs

示例6: CreateFirstDisplayWindow

        private void CreateFirstDisplayWindow(Manager manager, GameInfo gameInfo, Story red, Story black)
        {
            const int spacing = 20;
            const int width = 500;
            int yPos = spacing;
            var window = new Window(manager) { Text = "Story card", Width = 600 };
            window.Init();

            var descriptionlabel = new Label(manager) { Text = red.DisplayedMessage, Top = yPos, Width = width, Height = 70, Left = 30};
            descriptionlabel.Text =
                "When this window closes you will be required to spin the spinner.\n" +
                "If the spinner lands on a black spot you will undergo what the black card says.\n" +
                "If the spinner lands on a red spot you will undergo what the red card says.\n\n" +
                "These are stories you are spinning for!";
            yPos += descriptionlabel.Height + spacing / 2;

            var redstorybox = new GroupBox(manager) { Width = 500, Height = 100, Left = 30, Top = 100, Parent = window, Color = Color.Red, Text = "Red Story", TextColor = Color.White};
            redstorybox.Init();
            yPos += redstorybox.Height;
            var redstorylabel = new Label(manager)
                                    {
                                        Width = redstorybox.Width,
                                        Height = redstorybox.Height,
                                        Parent = redstorybox,
                                        Text = red.DisplayedMessage,
                                        Left = spacing,
                                        StayOnTop = true
                                    };
            redstorylabel.Init();

            var blackstorybox = new GroupBox(manager) { Width = 500, Height = 100, Left = 30, Top = 200, Parent = window, Color = Color.Black, Text = "Black Story", TextColor = Color.White };
            blackstorybox.Init();
            yPos += blackstorybox.Height+spacing/2;

            var blackstorylabel = new Label(manager)
            {
                Width = blackstorybox.Width,
                Height = blackstorybox.Height,
                Parent = blackstorybox,
                Text = black.DisplayedMessage,
                Left = spacing,
                StayOnTop = true
            };
            blackstorylabel.Init();

            var close = new Button(manager) { Text = "OK", Top = yPos, Left = window.Width / 2 - 50, Parent = window };
            close.Init();
            close.Click += (sender, args) => window.Close();
            yPos += close.Height + spacing;

            window.Add(descriptionlabel);
            window.Height = blackstorybox.Height + redstorybox.Height + yPos/2;
            manager.Add(window);

            window.Closed += (sender, args) => WindowClosed(gameInfo);

            gameInfo.CreateMessage("Click the spinner to see your story!");
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:58,代码来源:BlankStory.cs

示例7: SellCurrentHouse

 private void SellCurrentHouse(ConfirmWindow window, GameInfo gameInfo, IGameState waitState)
 {
     gameInfo.CurrentPlayer.Remove(gameInfo.CurrentPlayer.House);
     gameInfo.CreateMessage(String.Format("{0} just sold a house!", gameInfo.CurrentPlayer.Name));
     window.Close();
     OfferPlayerHouse(gameInfo, waitState);
 }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:7,代码来源:BuyHouse.cs

示例8: BuyNewHouse

        private void BuyNewHouse(ConfirmWindow window, GameInfo gameInfo, IGameState waitState)
        {
            gameInfo.CurrentPlayer.Accept(House);

            CloseWindow(window, gameInfo, waitState);
            gameInfo.CreateMessage(String.Format("{0} just bought a house!", gameInfo.CurrentPlayer.Name));
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:7,代码来源:BuyHouse.cs

示例9: NodeChosen

        private void NodeChosen(Node node, GameInfo gameInfo, IGameState waitState)
        {
            gameInfo.Fsm.Remove(waitState);
            gameInfo.ClearTargets();
            gameInfo.PanCameraToObject(gameInfo.CurrentPlayer);
            var currentPlayer = gameInfo.CurrentPlayer;
            currentPlayer.NextNode = node;

            // Give the player a passport for the island they are going to arrive at
            var assetResponse = currentPlayer.Accept(new PassportStamp(((Travel)node.BindedLogic.PureLogic).IslandType));
            // Give the player a car modification if required

            currentPlayer.SetTransport(TransportType);

            if (assetResponse == AssetResponse.CollectedAllPassportStamps) {
                if(gameInfo.GameRuleType == GameRuleType.Passport) {
                    gameInfo.Fsm.LazyPush(StateFactory.GetState(GameStates.GameStates.EndGame));
                }
            }

            gameInfo.CreateMessage(String.Format("You have been given a {0} passport token!", IslandType));

            gameInfo.Fsm.Push(StateFactory.GetState(GameStates.GameStates.VisuallyMovePlayer));
        }
开发者ID:AlanFoster,项目名称:Game-of-Life,代码行数:24,代码来源:Travel.cs


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