本文整理汇总了C#中IGameEngine类的典型用法代码示例。如果您正苦于以下问题:C# IGameEngine类的具体用法?C# IGameEngine怎么用?C# IGameEngine使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IGameEngine类属于命名空间,在下文中一共展示了IGameEngine类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateFromNewData
public void UpdateFromNewData(IGameEngine engine)
{
foreach (PainterBase p in m_painters)
{
p.UpdateFromNewData(engine, CalculateMapCorner(engine));
}
}
示例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();
}
示例3: UpdateFromNewData
public override void UpdateFromNewData(IGameEngine engine, Point mapUpCorner, Point cursorPosition)
{
if (m_isSelectionCursor)
{
m_currentToolTips = engine.GameState.GetDescriptionForTile(cursorPosition);
}
}
示例4: GameController
public GameController(IGameEngine gameEngine, IInputHandler inputReader, IRenderer renderer)
{
this.gameEngine = gameEngine;
this.inputReader = inputReader;
this.renderer = renderer;
this.currentCmd = null;
}
示例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;
}
示例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;
}
}
示例7: MainWindowViewModel
public MainWindowViewModel(IGameEngine gameEngine, IObservable<IGameEvent> events,
IViewController viewController)
{
_events = events;
_viewController = viewController;
GameEngine = gameEngine;
Hit = new ActionCommand(OnPlayerHit2);
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例12: GameEngineEventsListnerBase
protected GameEngineEventsListnerBase(IGameEngine gameEngine)
{
gameEngine.PlayerLoggedIn += OnPlayerLoggedIn;
gameEngine.PlayerLoggedOut += OnPlayerLoggedOut;
gameEngine.GameCreated += OnGameCreated;
gameEngine.GameJoined += OnGameJoined;
gameEngine.GameEnded += OnGameEnded;
gameEngine.TurnMade += OnTurnMade;
}
示例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;
}
}
示例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);
}
}
示例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
}