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

C# IGameEngine类代码示例

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

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



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

示例1: UpdateFromNewData

 public void UpdateFromNewData(IGameEngine engine)
 {
     foreach (PainterBase p in m_painters)
     {
         p.UpdateFromNewData(engine, CalculateMapCorner(engine));
     }
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:7,代码来源:MapPaintingCoordinator.cs


示例2: RunningKeyboardHandler

 public RunningKeyboardHandler(GameWindow window, IGameEngine engine)
 {
     m_window = window;
     m_engine = engine;
     m_lock = new object();
     m_dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:7,代码来源:RunningKeyboardHandler.cs


示例3: UpdateFromNewData

 public override void UpdateFromNewData(IGameEngine engine, Point mapUpCorner, Point cursorPosition)
 {
     if (m_isSelectionCursor)
     {
         m_currentToolTips = engine.GameState.GetDescriptionForTile(cursorPosition);
     }
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:7,代码来源:MapCursorPainter.cs


示例4: GameController

 public GameController(IGameEngine gameEngine, IInputHandler inputReader, IRenderer renderer)
 {
     this.gameEngine = gameEngine;
     this.inputReader = inputReader;
     this.renderer = renderer;
     this.currentCmd = null;
 }
开发者ID:hristofornikolov,项目名称:TeamSupremeProject,代码行数:7,代码来源:GameController.cs


示例5: MoveSelectionToNewPointSearchDirection

 /// <summary>
 /// So the idea here is that we can't move to our desired spot, because it's not valid. 
 /// To try to find where the player wanted to go, we lineraly search SelectionSearchLength
 /// points in a direction looking for a good position. If nothing is found, MoveSelectionToNewPoint
 /// calls this again with an offset that has us look one tile in the perpendicular direction
 /// for a matching tile. This is so something like this
 ///   . 
 /// . @ .
 ///   . 
 /// can allow one from moving from the south to the east point.
 /// </summary>
 /// <param name="engine">Game Engine</param>
 /// <param name="pointWantToGoTo">Where was the original ideal point</param>
 /// <param name="directionFromCenter">What direction was this from the center</param>
 /// <param name="offsets">Which ways to shift if we're trying for nearby matches</param>
 /// <returns></returns>
 private static Point MoveSelectionToNewPointSearchDirection(IGameEngine engine, Point pointWantToGoTo, Direction directionFromCenter, List<Point> offsets, List<EffectivePoint> targetablePoints)
 {
     Point nextSelectionAttempt = pointWantToGoTo;
     const int SelectionSearchLength = 20;
     for (int i = 0; i < SelectionSearchLength; ++i)
     {
         if (i != 0)
             nextSelectionAttempt = PointDirectionUtils.ConvertDirectionToDestinationPoint(nextSelectionAttempt, directionFromCenter);
         if (EffectivePoint.PositionInTargetablePoints(nextSelectionAttempt, targetablePoints))
         {
             return nextSelectionAttempt;
         }
         if (offsets != null)
         {
             foreach (Point o in offsets)
             {
                 if (EffectivePoint.PositionInTargetablePoints(nextSelectionAttempt + o, targetablePoints))
                 {
                     return nextSelectionAttempt + o;
                 }
             }
         }
     }
     return Point.Invalid;
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:41,代码来源:TargetHandlerHelper.cs


示例6: OnKeyboardDown

        public void OnKeyboardDown(MagecrawlKey key, Map map, GameWindow window, IGameEngine engine)
        {
            switch (key)
            {
                case MagecrawlKey.Enter:
                {
                    ICharacter possiblyTargettedMonster = engine.Map.Monsters.Where(x => x.Position == map.TargetPoint).FirstOrDefault();

                    // Rememeber last targetted monster so we can target them again by default next turn.
                    if (m_targettingType == TargettingType.Monster && possiblyTargettedMonster != null)
                        m_lastTargetted = possiblyTargettedMonster;

                    if (m_action != null)
                    {
                        m_action(window, engine, map.TargetPoint);
                        m_action = null;
                    }

                    Escape(map, window);
                    break;
                }
                case MagecrawlKey.Escape:
                {
                    Escape(map, window);
                    break;
                }
                case MagecrawlKey.v:
                {
                    Escape(map, window);
                    break;
                }
                case MagecrawlKey.Left:
                    HandleDirection(Direction.West, map, window, engine);
                    break;
                case MagecrawlKey.Right:
                    HandleDirection(Direction.East, map, window, engine);
                    break;
                case MagecrawlKey.Down:
                    HandleDirection(Direction.South, map, window, engine);
                    break;
                case MagecrawlKey.Up:
                    HandleDirection(Direction.North, map, window, engine);
                    break;
                case MagecrawlKey.Insert:
                    HandleDirection(Direction.Northwest, map, window, engine);
                    break;
                case MagecrawlKey.Delete:
                    HandleDirection(Direction.Southwest, map, window, engine);
                    break;
                case MagecrawlKey.PageUp:
                    HandleDirection(Direction.Northeast, map, window, engine);
                    break;
                case MagecrawlKey.PageDown:
                    HandleDirection(Direction.Southeast, map, window, engine);
                    break;
                default:
                    break;
            }
        }
开发者ID:donblas,项目名称:magecrawl,代码行数:59,代码来源:TargettingModeKeyboardHandler.cs


示例7: MainWindowViewModel

 public MainWindowViewModel(IGameEngine gameEngine, IObservable<IGameEvent> events,
                            IViewController viewController)
 {
     _events = events;
     _viewController = viewController;
     GameEngine = gameEngine;
     Hit = new ActionCommand(OnPlayerHit2);
 }
开发者ID:rho24,项目名称:Golf,代码行数:8,代码来源:MainWindowViewModel.cs


示例8: Game

 public Game(IOutputAdapter outputAdapter, IGameEngine gameEngine, IPlayer firstPlayer, IPlayer secondPlayer, int waitBetweenMoves = 0)
 {
     _outputAdapter = outputAdapter;
     _gameEngine = gameEngine;
     _players[0] = firstPlayer;
     _players[1] = secondPlayer;
     _waitBetweenMoves = waitBetweenMoves;
 }
开发者ID:AdrianNeilBerry,项目名称:TicTacToe,代码行数:8,代码来源:Game.cs


示例9: UpdateFromNewData

        public override void UpdateFromNewData(IGameEngine engine, Point mapUpCorner, Point cursorPosition)
        {
            CalculateMovability(engine);

            m_width = engine.Map.Width;
            m_height = engine.Map.Height;
            m_mapUpCorner = mapUpCorner;
        }
开发者ID:donblas,项目名称:magecrawl,代码行数:8,代码来源:MapDebugMovablePainter.cs


示例10: GameManager

 public GameManager(IGameRepository gameRepository, IGameValidator gameValidator, IGameCriteria gameCriteria, IGameEngine gameEngine, IRatingRepository ratingRepository)
 {
     _GameRepository = gameRepository;// Ioc.Container.Get<IGameRepository>();
     _GameValidator = gameValidator;
     _GameCriteria = gameCriteria;
     _GameEngine = gameEngine;
     _RatingRepository = ratingRepository;
 }
开发者ID:gareth-reid,项目名称:Rockmelon,代码行数:8,代码来源:GameManager.cs


示例11: CalculateFOV

 private void CalculateFOV(IGameEngine engine)
 {
     // This is expensive, so only do if we've going to use it
     if (m_enabled)
     {
         m_playerFOV = engine.Debugger.CellsInPlayersFOV();
         m_monsterFOV = engine.Debugger.CellsInAllMonstersFOV();
     }
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:9,代码来源:MapDebugFOVPainter.cs


示例12: GameEngineEventsListnerBase

 protected GameEngineEventsListnerBase(IGameEngine gameEngine)
 {
     gameEngine.PlayerLoggedIn += OnPlayerLoggedIn;
     gameEngine.PlayerLoggedOut += OnPlayerLoggedOut;
     gameEngine.GameCreated += OnGameCreated;
     gameEngine.GameJoined += OnGameJoined;
     gameEngine.GameEnded += OnGameEnded;
     gameEngine.TurnMade += OnTurnMade;
 }
开发者ID:qrow,项目名称:TicTacToeOnline,代码行数:9,代码来源:GameEngineEventsListnerBase.cs


示例13: UpdateFromNewData

 public override void UpdateFromNewData(IGameEngine engine, Point mapUpCorner, Point cursorPosition)
 {
     if (m_enabled)
     {
         m_map = engine.Map;
         m_mapCorner = mapUpCorner;
         m_cursorPosition = cursorPosition;
     }
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:9,代码来源:MapFOVPainter.cs


示例14: UpdateFromNewData

 public void UpdateFromNewData(IGameEngine engine)
 {
     TileVisibility[,] tileVisibility = engine.GameState.CalculateTileVisibility();
     Point mapCorner = CalculateMapCorner(engine);
     foreach (PainterBase p in m_painters)
     {
         p.UpdateFromVisibilityData(tileVisibility); // Needs to be called before FromNewData.
         p.UpdateFromNewData(engine, mapCorner, MapCursorEnabled ? CursorSpot : engine.Player.Position);
     }
 }
开发者ID:donblas,项目名称:magecrawl,代码行数:10,代码来源:PaintingCoordinator.cs


示例15: RestartGame

        private void RestartGame(IGameEngine engine)
        {
            engine.Dispose();
            engine.Logger.LogMessageAndGoNextLine(Resources.GameMessagesResources.StartingNewGame);
            engine.StartGame();

            ////pri restart trqbva da se napravi prototypePattern i s observer da se zakachim
            //// i da trigger- nem eventa koito shte vzeme predishniq state /v nachaloto na igrata na obektite
            //// i shte zapochne s tqh
        }
开发者ID:siderisltd,项目名称:HQC-Team-BullsAndCows4,代码行数:10,代码来源:RestartGameCommand.cs


示例16: CreateCommand

        public IGameCommand CreateCommand(string[] commandArguments, IGameEngine engine)
        {
            string replacedString = commandArguments[0].Replace("-", string.Empty);
            string commandName = replacedString + ValidationControl.CommandStringPostFix;
            Type currentType = assemblyCommandTypes.FirstOrDefault(x => x.Name.ToLower() == commandName);

            IGameCommand currentCommand = Activator.CreateInstance(currentType, engine) as IGameCommand;

            return currentCommand;
        }
开发者ID:ROSSFilipov,项目名称:CSharp,代码行数:10,代码来源:CommandFactory.cs


示例17: MainWindow

        public MainWindow(IGameEngine gameEngine)
        {
            GameEngine = gameEngine;

            var rand = new Random();
            GameEngine.Events.OfType<GameObjectCreated>().Subscribe(
                e => Canvas.Children.Add(new GolfBall {X = rand.NextDouble()*600, Y = rand.NextDouble()*400}));

            InitializeComponent();
        }
开发者ID:veggielane,项目名称:Golf,代码行数:10,代码来源:MainWindow.xaml.cs


示例18: PauseGame

        private void PauseGame(IGameEngine engine)
        {
            engine.Logger.LogMessageAndGoNextLine(Resources.GameMessagesResources.UnpauseMessage);

            var keyPressed = engine.Logger.ReadKey(true);
            while (keyPressed.Key != ConsoleKey.Escape)
            {
                engine.Logger.LogMessageAndGoNextLine(Resources.GameMessagesResources.UnpauseMessage);
                keyPressed = engine.Logger.ReadKey(true);
            }
        }
开发者ID:siderisltd,项目名称:HQC-Team-BullsAndCows4,代码行数:11,代码来源:PauseGameCommand.cs


示例19: GetStyles

 public static IStyles GetStyles(IGameEngine game)
 {
     if (game is Threes)
         return new ThreesStyles(game.GetMaxNumber());
     else if (game is Fives)
         return new FivesStyles();
     else if (game is Eights)
         return new EightsStyles();
     else if (game is TwentyFortyEight)
         return new TwentyFortyEightStyles();
     throw new NotSupportedException(String.Format("Styles not implemented for {0}", game.GetType().Name));
 }
开发者ID:hubbardgary,项目名称:NumberWang,代码行数:12,代码来源:StylesFactory.cs


示例20: TargettingModeKeyboardHandler

        public TargettingModeKeyboardHandler(TargettingType targettingType, IGameEngine engine, Map map, List<EffectivePoint> targetablePoints)
        {
            m_targetablePoints = targetablePoints;

            m_targettingType = targettingType;
            
            map.InTargettingMode = true;
            map.TargetPoint = SetTargettingInitialSpot(engine);
            if (m_targetablePoints != null)
                map.TargetablePoints = m_targetablePoints;

            m_lastTargetted = null;
        }
开发者ID:donblas,项目名称:magecrawl,代码行数:13,代码来源:TargettingModeKeyboardHandler.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IGameMessageHandler类代码示例发布时间:2022-05-24
下一篇:
C# IGameContext类代码示例发布时间: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