public PuzzleGame(PuzzleGrid puzzleGrid, HealthBar playerHealth, Team activeTeam, MonsterGrid monsterGrid) { _monsterGrid = monsterGrid; _activeTeam = activeTeam; _playerHealth = playerHealth; _puzzleGrid = puzzleGrid; MessageBus.Default.Register("EndTurn", OnEndTurn); }
public void AddHeroes(Team activeTeam) { _activeTeam = activeTeam; foreach (var teamMember in activeTeam.TeamMembers) { AddTeamMember(teamMember, LayoutRoot); } }
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); }
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(); }
public TeamSelection() { _heroRepository = new HeroRepository(); _teamRepository = new TeamRepository(); var teamFromDatabase = _teamRepository.GetTeam(); _activeTeam = new Team(teamFromDatabase); InitializeComponent(); ShowTeam(); LoadTeamStats(); LoadAvailableHeroes(); }
public void SaveTeam(Team team) { var teamMemberForDatabase = TeamMemberMapper.Map(team.TeamMembers); var teamForDatabase = new TeamToSaveToDatabase(team.TeamId, teamMemberForDatabase); SaveTeam(teamForDatabase); }
private Task MonsterAttacksPlayer(Monster monster, Team activePlayerTeam, HealthBar playerHealth) { var monsterAttackDamage = monster.AttackDamage; activePlayerTeam.TakeDamage(1000); return playerHealth.SetHealthPercentage(activePlayerTeam.CurrentHealth, activePlayerTeam.TotalHealth); }
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); }
private Task PlayerHeals(Team activeTeam, List<OrbMatch> matches, HealthBar playerHealth) { activeTeam.Heal(matches); return playerHealth.SetHealthPercentage(_activeTeam.CurrentHealth, _activeTeam.TotalHealth); }