コード例 #1
0
        /// <summary>
        ///   Initialize the HandViewLayer.
        /// </summary>
        public HandViewLayer(GraphicsDeviceManager graphics, Controller controller)
        {
            _graphics = graphics;

            //Initialize the number of cards to draw from the players hand at a given time.
            _numTilesToDraw = 5;

            //Scale the tile to a manageable size
            //Change from magic numbers to finalized values later
            _tileDrawRectangleSize = new Vector2(100, 100);

            // Scale arrow to be the right size
            _arrowDrawRectangleSize = new Vector2(100, 100);

            _lastSelectedTileIndex = 0;

            _controller = controller;

            _selectedTileIndex = _numTilesToDraw/2;
        }
コード例 #2
0
 public void TestInitialize()
 {
     Controller.Initialize(new MockDeck());
     _control = Controller.DefaultInstance;
 }
コード例 #3
0
 public void TestInitialize()
 {
     Controller.Initialize();
     _control = Controller.DefaultInstance;
 }
コード例 #4
0
 /// <summary>
 ///   Initializes a new game with the given deck and player list.
 /// </summary>
 public static void Initialize(Deck deck, params Player[] players)
 {
     _instance = new Controller(deck, players);
 }
コード例 #5
0
 /// <summary>
 ///   Initializes a new game with the default deck and player list.
 /// </summary>
 public static void Initialize()
 {
     _instance = null;
 }
コード例 #6
0
 /// <summary>
 ///   Gets the singleton controller using provided players
 /// </summary>
 public static Controller CustomInstance(Player[] players)
 {
     _instance = new Controller(new InfiniteDeck(), players);
     return _instance;
 }
コード例 #7
0
        /// <summary>
        ///   Initialize a new game if new controllers/models/views are necessary. This is usually done 
        ///   when Options changes some settings and various objects need to be reinitialized.
        /// </summary>
        /// <param name = "players">Players playing the game</param>
        private void InitializeNewGame(Player[] players)
        {
            IsMouseVisible = true;
            _camera = new Camera(_graphics);

            // Why is the board starting at (1600,1100)? No one knows....
            _camera.PointTo(new Vector2(1600, 1100));

            _controller = Controller.CustomInstance(players);

            _selectionManager = _controller;

            _oldKeyboardState = Keyboard.GetState();

            _boardViewLayer = new BoardViewLayer(_graphics, _controller);

            _handViewLayer = new HandViewLayer(_graphics, _controller) {IsCustom = false};

            _customViewLayer = new HandViewLayer(_graphics, _controller) {IsCustom = true};

            // a blank tile for each player, colors get added later
            _playerSelection = new Tile[_controller.Players.Count()];
            for (int i = 0; i<_controller.Players.Count(); i++)
                _playerSelection[i] = new Blank {Owner = _controller.Players.ElementAt(i), Space = new Space()};
            _selectionPoint = new Point(0, 0);

            _moveCamera = true;

            _oldColor = Color.Wheat;

            _displayHelp = false;

            _endGame = false;

            base.Initialize();
        }
コード例 #8
0
 public BoardViewLayer(GraphicsDeviceManager graphics, Controller control)
 {
     _graphics = graphics;
     _control = control;
 }