コード例 #1
0
 public PuzzleGame(PuzzleGrid puzzleGrid, HealthBar playerHealth, Team activeTeam, MonsterGrid monsterGrid)
 {
     _monsterGrid = monsterGrid;
     _activeTeam = activeTeam;
     _playerHealth = playerHealth;
     _puzzleGrid = puzzleGrid;
     MessageBus.Default.Register("EndTurn", OnEndTurn);
 }
コード例 #2
0
 public void AddHeroes(Team activeTeam)
 {
     _activeTeam = activeTeam;
     foreach (var teamMember in activeTeam.TeamMembers)
     {
         AddTeamMember(teamMember, LayoutRoot);
     }
 }
コード例 #3
0
        public void Draw(Team team)
        {
            var heroes = team.TeamMembers.Select(tm => tm.ThisHero).ToList();

            TotalHealth.Text = "Total health is " + heroes.Sum(h => h.HitPoints);
            HealsFor.Text = "Heals for " + heroes.Sum(h => h.HealsFor);

            EarthAttacksFor.Text = GetDamageMessage(heroes, AppGlobals.Types.Earth);
            WaterAttacksFor.Text = GetDamageMessage(heroes, AppGlobals.Types.Water);
            WoodAttacksFor.Text = GetDamageMessage(heroes, AppGlobals.Types.Wood);
            FireAttacksFor.Text = GetDamageMessage(heroes, AppGlobals.Types.Fire);
        }
コード例 #4
0
        public async void LoadGraphics(object sender, RoutedEventArgs e)
        {
            var monsterGrid = new MonsterGrid(MonsterGrid, _activeDungeon);

            var teamFromDatabase = _teamRepository.GetTeam();
            var activeTeam = new Team(teamFromDatabase);
            HeroGrid.AddHeroes(activeTeam);
            PlayerHealth.HealthPercentage.ColumnDefinitions[0].MaxWidth = PlayerHealth.HealthPercentage.ActualWidth;

            _puzzleGrid = new PuzzleGrid(PuzzleGrid, AppGlobals.PuzzleGridRowCount, AppGlobals.PuzzleGridColumnCount);

            _puzzleGame = new PuzzleGame(_puzzleGrid, PlayerHealth, activeTeam, monsterGrid);
            _puzzleGame.StartGame();
        }
コード例 #5
0
        public TeamSelection()
        {
            _heroRepository = new HeroRepository();
            _teamRepository = new TeamRepository();

            var teamFromDatabase = _teamRepository.GetTeam();
            _activeTeam = new Team(teamFromDatabase);

            InitializeComponent();

            ShowTeam();
            LoadTeamStats();
            LoadAvailableHeroes();
        }
コード例 #6
0
 public void SaveTeam(Team team)
 {
     var teamMemberForDatabase = TeamMemberMapper.Map(team.TeamMembers);
     var teamForDatabase = new TeamToSaveToDatabase(team.TeamId, teamMemberForDatabase);
     SaveTeam(teamForDatabase);
 }
コード例 #7
0
 private Task MonsterAttacksPlayer(Monster monster, Team activePlayerTeam, HealthBar playerHealth)
 {
     var monsterAttackDamage = monster.AttackDamage;
     activePlayerTeam.TakeDamage(1000);
     return playerHealth.SetHealthPercentage(activePlayerTeam.CurrentHealth, activePlayerTeam.TotalHealth);
 }
コード例 #8
0
 private Task PlayerAttacksMonster(MonsterGrid monsterGrid, Team activeTeam, List<OrbMatch> matches)
 {
     var playerAttack = activeTeam.CalculateDamage(matches);
     var monster = monsterGrid.ActiveMonster;
     monster.TakeDamage(playerAttack);
     return monsterGrid.MonsterHealth.SetHealthPercentage(monster.CurrentHealth, monster.TotalHealth);
 }
コード例 #9
0
 private Task PlayerHeals(Team activeTeam, List<OrbMatch> matches, HealthBar playerHealth)
 {
     activeTeam.Heal(matches);
     return playerHealth.SetHealthPercentage(_activeTeam.CurrentHealth, _activeTeam.TotalHealth);
 }