Пример #1
0
 public BoardBehavior(int width, int height, string boardName)
 {
     _width = width;
     _height = height;
     _boardName = boardName;
     _syncedPlayers = 0;
     _game = new Game(_width, _height);
     _gamePieces = new List<GamePiece>();
     _selectedPiece = new GamePiece(new Point(0, 0));
     var repository = new Repository();
     _creaturesRepository = repository.Creatures;
     _heroesRepository = repository.Heroes;
     _userRepository = repository.Users;
 }
Пример #2
0
 private void FillTable(int x, int y, AbstractHero hero, IEnumerable<AbstractCreature> creatures)
 {
     foreach (var creatureComponent in creatures)
     {
         var piece = new GamePiece(new Point(x, y));
         _gamePieces.Add(piece);
         _game.BlockOutTiles(x, y);
         creatureComponent.Count = 5;
         creatureComponent.Piece = new Point(x, y);
         creatureComponent.Index = _gamePieces.Count;
         hero.Creatures.Add(creatureComponent);
         Creatures.Add(creatureComponent);
         y -= 2;
     }
 }