コード例 #1
0
ファイル: RotationGame.cs プロジェクト: kevholditch/Rotation
 public RotationGame(IContainer container, IBoard board, IBoardFiller boardFiller, IGameEventDispatcher gameEventDispatcher, IAnimationEngine animationEngine, IGameStateController gameStateController)
 {
     _container = container;
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     _board = board;
     _boardFiller = boardFiller;
     _animationEngine = animationEngine;
     _gameStateController = gameStateController;
     GameEvents.Dispatcher = gameEventDispatcher;
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GameFactory"/> type.
 /// </summary>
 /// <param name="filler">Filler used to fill the game board.</param>
 public GameFactory(IBoardFiller filler)
 {
     this.filler = filler;
 }
コード例 #3
0
 /// <summary>
 /// Initializes the board by using the given filler.
 /// </summary>
 /// <param name="filler">Filler to use for filling the board</param>
 /// <remarks>
 /// The board (i.e., everything is set to water) is cleared before filling it.
 /// </remarks>
 public void Initialize(IBoardFiller filler)
 {
     Clear(SquareContent.Water);
     filler.Fill(Ships, this);
 }