Best JavaScript code snippet using ng-mocks
Duels.game.ts
Source:Duels.game.ts
...642 }643 // someone please optimize this im too dumb with typescript !!!!!!!!!!!!!!!! HELPPPP !!!!!!!!!!644 model.stats.Duels.division = getDivision('all_modes');645 // GAME STATS646 model.stats.Duels.coins = handleSection(model.stats.Duels.coins, coins);647 model.stats.Duels.lootChests = duels_chests;648 model.stats.Duels.wins = handleSection(model.stats.Duels.wins, wins);649 model.stats.Duels.losses = handleSection(model.stats.Duels.losses, losses);650 model.stats.Duels.kills = handleSection(model.stats.Duels.kills, kills);651 model.stats.Duels.deaths = handleSection(model.stats.Duels.deaths, deaths);652 model.stats.Duels.swings = handleSection(model.stats.Duels.swings, melee_swings);653 model.stats.Duels.hits = handleSection(model.stats.Duels.hits, melee_hits);654 model.stats.Duels.arrowsShot = handleSection(model.stats.Duels.arrowsShot, bow_shots);655 model.stats.Duels.arrowsHit = handleSection(model.stats.Duels.arrowsHit, bow_hits);656 model.stats.Duels.winstreaks.current = handleSection(model.stats.Duels.winstreaks.current, current_winstreak);657 model.stats.Duels.winstreaks.best = handleSection(model.stats.Duels.winstreaks.best, best_overall_winstreak);658 model.stats.Duels.modes.uhc_duel.division = getDivision('uhc');659 // UHC 1v1660 model.stats.Duels.modes.uhc_duel.kills = handleSection(model.stats.Duels.modes.uhc_duel.kills, uhc_duel_kills);661 model.stats.Duels.modes.uhc_duel.deaths = handleSection(model.stats.Duels.modes.uhc_duel.deaths, uhc_duel_deaths);662 model.stats.Duels.modes.uhc_duel.wins = handleSection(model.stats.Duels.modes.uhc_duel.wins, uhc_duel_wins);663 model.stats.Duels.modes.uhc_duel.losses = handleSection(model.stats.Duels.modes.uhc_duel.losses, uhc_duel_losses);664 model.stats.Duels.modes.uhc_duel.winstreaks.best = handleSection(model.stats.Duels.modes.uhc_duel.winstreaks.best, best_uhc_winstreak);665 model.stats.Duels.modes.uhc_duel.winstreaks.current = handleSection(model.stats.Duels.modes.uhc_duel.winstreaks.current, current_uhc_winstreak);666 model.stats.Duels.modes.uhc_duel.swings = handleSection(model.stats.Duels.modes.uhc_duel.swings, uhc_duel_melee_swings);667 model.stats.Duels.modes.uhc_duel.hits = handleSection(model.stats.Duels.modes.uhc_duel.hits, uhc_duel_melee_hits);668 model.stats.Duels.modes.uhc_duel.arrowsShot = handleSection(model.stats.Duels.modes.uhc_duel.arrowsShot, uhc_duel_bow_shots);669 model.stats.Duels.modes.uhc_duel.arrowsHit = handleSection(model.stats.Duels.modes.uhc_duel.arrowsHit, uhc_duel_bow_hits);670 // UHC 2v2671 model.stats.Duels.modes.uhc_doubles.kills = handleSection(model.stats.Duels.modes.uhc_doubles.kills, uhc_doubles_kills);672 model.stats.Duels.modes.uhc_doubles.deaths = handleSection(model.stats.Duels.modes.uhc_doubles.deaths, uhc_doubles_deaths);673 model.stats.Duels.modes.uhc_doubles.wins = handleSection(model.stats.Duels.modes.uhc_doubles.wins, uhc_doubles_wins);674 model.stats.Duels.modes.uhc_doubles.losses = handleSection(model.stats.Duels.modes.uhc_doubles.losses, uhc_doubles_losses);675 model.stats.Duels.modes.uhc_doubles.winstreaks.best = handleSection(model.stats.Duels.modes.uhc_doubles.winstreaks.best, best_uhc_winstreak);676 model.stats.Duels.modes.uhc_doubles.winstreaks.current = handleSection(model.stats.Duels.modes.uhc_doubles.winstreaks.current, current_uhc_winstreak);677 model.stats.Duels.modes.uhc_doubles.swings = handleSection(model.stats.Duels.modes.uhc_doubles.swings, uhc_doubles_melee_swings);678 model.stats.Duels.modes.uhc_doubles.hits = handleSection(model.stats.Duels.modes.uhc_doubles.hits, uhc_doubles_melee_hits);679 model.stats.Duels.modes.uhc_doubles.arrowsShot = handleSection(model.stats.Duels.modes.uhc_doubles.arrowsShot, uhc_doubles_bow_shots);680 model.stats.Duels.modes.uhc_doubles.arrowsHit = handleSection(model.stats.Duels.modes.uhc_doubles.arrowsHit, uhc_doubles_bow_hits);681 // UHC 4v4682 model.stats.Duels.modes.uhc_four.kills = handleSection(model.stats.Duels.modes.uhc_four.kills, uhc_four_kills);683 model.stats.Duels.modes.uhc_four.deaths = handleSection(model.stats.Duels.modes.uhc_four.deaths, uhc_four_deaths);684 model.stats.Duels.modes.uhc_four.wins = handleSection(model.stats.Duels.modes.uhc_four.wins, uhc_four_wins);685 model.stats.Duels.modes.uhc_four.losses = handleSection(model.stats.Duels.modes.uhc_four.losses, uhc_four_losses);686 model.stats.Duels.modes.uhc_four.winstreaks.best = handleSection(model.stats.Duels.modes.uhc_four.winstreaks.best, best_uhc_winstreak);687 model.stats.Duels.modes.uhc_four.winstreaks.current = handleSection(model.stats.Duels.modes.uhc_four.winstreaks.current, current_uhc_winstreak);688 model.stats.Duels.modes.uhc_four.swings = handleSection(model.stats.Duels.modes.uhc_four.swings, uhc_four_melee_swings);689 model.stats.Duels.modes.uhc_four.hits = handleSection(model.stats.Duels.modes.uhc_four.hits, uhc_four_melee_hits);690 model.stats.Duels.modes.uhc_four.arrowsShot = handleSection(model.stats.Duels.modes.uhc_four.arrowsShot, uhc_four_bow_shots);691 model.stats.Duels.modes.uhc_four.arrowsHit = handleSection(model.stats.Duels.modes.uhc_four.arrowsHit, uhc_four_bow_hits);692 // UHC Meetup693 model.stats.Duels.modes.uhc_meetup.kills = handleSection(model.stats.Duels.modes.uhc_meetup.kills, uhc_meetup_kills);694 model.stats.Duels.modes.uhc_meetup.deaths = handleSection(model.stats.Duels.modes.uhc_meetup.deaths, uhc_meetup_deaths);695 model.stats.Duels.modes.uhc_meetup.wins = handleSection(model.stats.Duels.modes.uhc_meetup.wins, uhc_meetup_wins);696 model.stats.Duels.modes.uhc_meetup.losses = handleSection(model.stats.Duels.modes.uhc_meetup.losses, uhc_meetup_losses);697 model.stats.Duels.modes.uhc_meetup.winstreaks.best = handleSection(model.stats.Duels.modes.uhc_meetup.winstreaks.best, best_uhc_winstreak);698 model.stats.Duels.modes.uhc_meetup.winstreaks.current = handleSection(model.stats.Duels.modes.uhc_meetup.winstreaks.current, current_uhc_winstreak);699 model.stats.Duels.modes.uhc_meetup.swings = handleSection(model.stats.Duels.modes.uhc_meetup.swings, uhc_meetup_melee_swings);700 model.stats.Duels.modes.uhc_meetup.hits = handleSection(model.stats.Duels.modes.uhc_meetup.hits, uhc_meetup_melee_hits);701 model.stats.Duels.modes.uhc_meetup.arrowsShot = handleSection(model.stats.Duels.modes.uhc_meetup.arrowsShot, uhc_meetup_bow_hits);702 model.stats.Duels.modes.uhc_meetup.arrowsHit = handleSection(model.stats.Duels.modes.uhc_meetup.arrowsHit, uhc_meetup_bow_shots);703 model.stats.Duels.modes.op_duel.division = getDivision('op');704 // OP 1v1705 model.stats.Duels.modes.op_duel.kills = handleSection(model.stats.Duels.modes.op_duel.kills, op_duel_kills);706 model.stats.Duels.modes.op_duel.deaths = handleSection(model.stats.Duels.modes.op_duel.deaths, op_duel_deaths);707 model.stats.Duels.modes.op_duel.wins = handleSection(model.stats.Duels.modes.op_duel.wins, op_duel_wins);708 model.stats.Duels.modes.op_duel.losses = handleSection(model.stats.Duels.modes.op_duel.losses, op_duel_losses);709 model.stats.Duels.modes.op_duel.winstreaks.best = handleSection(model.stats.Duels.modes.op_duel.winstreaks.best, best_winstreak_mode_op_duel);710 model.stats.Duels.modes.op_duel.winstreaks.current = handleSection(model.stats.Duels.modes.op_duel.winstreaks.current, current_winstreak_mode_op_duel);711 model.stats.Duels.modes.op_duel.swings = handleSection(model.stats.Duels.modes.op_duel.swings, op_duel_melee_swings);712 model.stats.Duels.modes.op_duel.hits = handleSection(model.stats.Duels.modes.op_duel.hits, op_duel_melee_hits);713 model.stats.Duels.modes.op_duel.arrowsShot = handleSection(model.stats.Duels.modes.op_duel.arrowsShot, op_duel_bow_shots);714 model.stats.Duels.modes.op_duel.arrowsHit = handleSection(model.stats.Duels.modes.op_duel.arrowsHit, op_duel_bow_hits);715 // OP 2v2716 model.stats.Duels.modes.op_doubles.kills = handleSection(model.stats.Duels.modes.op_doubles.kills, op_doubles_kills);717 model.stats.Duels.modes.op_doubles.deaths = handleSection(model.stats.Duels.modes.op_doubles.deaths, op_doubles_deaths);718 model.stats.Duels.modes.op_doubles.wins = handleSection(model.stats.Duels.modes.op_doubles.wins, op_doubles_wins);719 model.stats.Duels.modes.op_doubles.losses = handleSection(model.stats.Duels.modes.op_doubles.losses, op_doubles_losses);720 model.stats.Duels.modes.op_doubles.winstreaks.best = handleSection(model.stats.Duels.modes.op_doubles.winstreaks.best, best_winstreak_mode_op_duel);721 model.stats.Duels.modes.op_doubles.winstreaks.current = handleSection(model.stats.Duels.modes.op_doubles.winstreaks.current, current_winstreak_mode_op_duel);722 model.stats.Duels.modes.op_doubles.swings = handleSection(model.stats.Duels.modes.op_doubles.swings, op_doubles_melee_swings);723 model.stats.Duels.modes.op_doubles.hits = handleSection(model.stats.Duels.modes.op_doubles.hits, op_doubles_melee_hits);724 model.stats.Duels.modes.op_doubles.arrowsShot = handleSection(model.stats.Duels.modes.op_doubles.arrowsShot, op_doubles_bow_shots);725 model.stats.Duels.modes.op_doubles.arrowsHit = handleSection(model.stats.Duels.modes.op_doubles.arrowsHit, op_doubles_bow_hits);726 model.stats.Duels.modes.sw_duel.division = getDivision('skywars');727 // SW 1v1728 model.stats.Duels.modes.sw_duel.kills = handleSection(model.stats.Duels.modes.sw_duel.kills, sw_duel_kills);729 model.stats.Duels.modes.sw_duel.deaths = handleSection(model.stats.Duels.modes.sw_duel.deaths, sw_duel_deaths);730 model.stats.Duels.modes.sw_duel.wins = handleSection(model.stats.Duels.modes.sw_duel.wins, sw_duel_wins);731 model.stats.Duels.modes.sw_duel.losses = handleSection(model.stats.Duels.modes.sw_duel.losses, sw_duel_losses);732 model.stats.Duels.modes.sw_duel.winstreaks.best = handleSection(model.stats.Duels.modes.sw_duel.winstreaks.best, best_winstreak_mode_sw_duel);733 model.stats.Duels.modes.sw_duel.winstreaks.current = handleSection(model.stats.Duels.modes.sw_duel.winstreaks.current, current_winstreak_mode_sw_duel);734 model.stats.Duels.modes.sw_duel.swings = handleSection(model.stats.Duels.modes.sw_duel.swings, sw_duel_melee_swings);735 model.stats.Duels.modes.sw_duel.hits = handleSection(model.stats.Duels.modes.sw_duel.hits, sw_duel_melee_hits);736 model.stats.Duels.modes.sw_duel.arrowsShot = handleSection(model.stats.Duels.modes.sw_duel.arrowsShot, sw_duel_bow_shots);737 model.stats.Duels.modes.sw_duel.arrowsHit = handleSection(model.stats.Duels.modes.sw_duel.arrowsHit, sw_duel_bow_hits);738 // SW 2v2739 model.stats.Duels.modes.sw_doubles.kills = handleSection(model.stats.Duels.modes.sw_doubles.kills, sw_doubles_kills);740 model.stats.Duels.modes.sw_doubles.deaths = handleSection(model.stats.Duels.modes.sw_doubles.deaths, sw_doubles_deaths);741 model.stats.Duels.modes.sw_doubles.wins = handleSection(model.stats.Duels.modes.sw_doubles.wins, sw_doubles_wins);742 model.stats.Duels.modes.sw_doubles.losses = handleSection(model.stats.Duels.modes.sw_doubles.losses, sw_doubles_losses);743 model.stats.Duels.modes.sw_doubles.winstreaks.best = handleSection(model.stats.Duels.modes.sw_doubles.winstreaks.best, best_winstreak_mode_sw_duel);744 model.stats.Duels.modes.sw_doubles.winstreaks.current = handleSection(model.stats.Duels.modes.sw_doubles.winstreaks.current, current_winstreak_mode_sw_duel);745 model.stats.Duels.modes.sw_doubles.swings = handleSection(model.stats.Duels.modes.sw_doubles.swings, sw_doubles_melee_swings);746 model.stats.Duels.modes.sw_doubles.hits = handleSection(model.stats.Duels.modes.sw_doubles.hits, sw_doubles_melee_hits);747 model.stats.Duels.modes.sw_doubles.arrowsShot = handleSection(model.stats.Duels.modes.sw_doubles.arrowsShot, sw_doubles_bow_shots);748 model.stats.Duels.modes.sw_doubles.arrowsHit = handleSection(model.stats.Duels.modes.sw_doubles.arrowsHit, sw_doubles_bow_hits);749 model.stats.Duels.modes.bow_duel.division = getDivision('bow');750 // Bow 1v1751 model.stats.Duels.modes.bow_duel.kills = handleSection(model.stats.Duels.modes.bow_duel.kills, bow_duel_kills);752 model.stats.Duels.modes.bow_duel.deaths = handleSection(model.stats.Duels.modes.bow_duel.deaths, bow_duel_deaths);753 model.stats.Duels.modes.bow_duel.wins = handleSection(model.stats.Duels.modes.bow_duel.wins, bow_duel_wins);754 model.stats.Duels.modes.bow_duel.losses = handleSection(model.stats.Duels.modes.bow_duel.losses, bow_duel_losses);755 model.stats.Duels.modes.bow_duel.winstreaks.best = handleSection(model.stats.Duels.modes.bow_duel.winstreaks.best, best_winstreak_mode_bow_duel);756 model.stats.Duels.modes.bow_duel.winstreaks.current = handleSection(model.stats.Duels.modes.bow_duel.winstreaks.current, current_winstreak_mode_bow_duel);757 model.stats.Duels.modes.bow_duel.swings = handleSection(model.stats.Duels.modes.bow_duel.swings, bow_duel_melee_swings);758 model.stats.Duels.modes.bow_duel.hits = handleSection(model.stats.Duels.modes.bow_duel.hits, bow_duel_melee_hits);759 model.stats.Duels.modes.bow_duel.arrowsShot = handleSection(model.stats.Duels.modes.bow_duel.arrowsShot, bow_duel_bow_shots);760 model.stats.Duels.modes.bow_duel.arrowsHit = handleSection(model.stats.Duels.modes.bow_duel.arrowsHit, bow_duel_bow_hits);761 model.stats.Duels.modes.blitz_duel.division = getDivision('blitz');762 // Blitz 1v1763 model.stats.Duels.modes.blitz_duel.kills = handleSection(model.stats.Duels.modes.blitz_duel.kills, blitz_duel_kills);764 model.stats.Duels.modes.blitz_duel.deaths = handleSection(model.stats.Duels.modes.blitz_duel.deaths, blitz_duel_deaths);765 model.stats.Duels.modes.blitz_duel.wins = handleSection(model.stats.Duels.modes.blitz_duel.wins, blitz_duel_wins);766 model.stats.Duels.modes.blitz_duel.losses = handleSection(model.stats.Duels.modes.blitz_duel.losses, blitz_duel_losses);767 model.stats.Duels.modes.blitz_duel.winstreaks.best = handleSection(model.stats.Duels.modes.blitz_duel.winstreaks.best, best_winstreak_mode_blitz_duel);768 model.stats.Duels.modes.blitz_duel.winstreaks.current = handleSection(model.stats.Duels.modes.blitz_duel.winstreaks.current, current_winstreak_mode_blitz_duel);769 model.stats.Duels.modes.blitz_duel.swings = handleSection(model.stats.Duels.modes.blitz_duel.swings, blitz_duel_melee_swings);770 model.stats.Duels.modes.blitz_duel.hits = handleSection(model.stats.Duels.modes.blitz_duel.hits, blitz_duel_melee_hits);771 model.stats.Duels.modes.blitz_duel.arrowsShot = handleSection(model.stats.Duels.modes.blitz_duel.arrowsShot, blitz_duel_bow_shots);772 model.stats.Duels.modes.blitz_duel.arrowsHit = handleSection(model.stats.Duels.modes.blitz_duel.arrowsHit, blitz_duel_bow_hits);773 model.stats.Duels.modes.mw_duel.division = getDivision('mega_walls');774 // MegaWalls775 model.stats.Duels.modes.mw_duel.kills = handleSection(model.stats.Duels.modes.mw_duel.kills, mw_duel_kills);776 model.stats.Duels.modes.mw_duel.deaths = handleSection(model.stats.Duels.modes.mw_duel.deaths, mw_duel_deaths);777 model.stats.Duels.modes.mw_duel.wins = handleSection(model.stats.Duels.modes.mw_duel.wins, mw_duel_wins);778 model.stats.Duels.modes.mw_duel.losses = handleSection(model.stats.Duels.modes.mw_duel.losses, mw_duel_losses);779 model.stats.Duels.modes.mw_duel.winstreaks.best = handleSection(model.stats.Duels.modes.mw_duel.winstreaks.best, best_winstreak_mode_mw_duel);780 model.stats.Duels.modes.mw_duel.winstreaks.current = handleSection(model.stats.Duels.modes.mw_duel.winstreaks.current, current_winstreak_mode_mw_duel);781 model.stats.Duels.modes.mw_duel.swings = handleSection(model.stats.Duels.modes.mw_duel.swings, mw_duel_melee_swings);782 model.stats.Duels.modes.mw_duel.hits = handleSection(model.stats.Duels.modes.mw_duel.hits, mw_duel_melee_hits);783 model.stats.Duels.modes.mw_duel.arrowsShot = handleSection(model.stats.Duels.modes.mw_duel.arrowsShot, mw_duel_bow_shots);784 model.stats.Duels.modes.mw_duel.arrowsHit = handleSection(model.stats.Duels.modes.mw_duel.arrowsHit, mw_duel_bow_hits);785 model.stats.Duels.modes.sumo_duel.division = getDivision('sumo');786 // Sumo 1v1787 model.stats.Duels.modes.sumo_duel.kills = handleSection(model.stats.Duels.modes.sumo_duel.kills, sumo_duel_kills);788 model.stats.Duels.modes.sumo_duel.deaths = handleSection(model.stats.Duels.modes.sumo_duel.deaths, sumo_duel_deaths);789 model.stats.Duels.modes.sumo_duel.wins = handleSection(model.stats.Duels.modes.sumo_duel.wins, sumo_duel_wins);790 model.stats.Duels.modes.sumo_duel.losses = handleSection(model.stats.Duels.modes.sumo_duel.losses, sumo_duel_losses);791 model.stats.Duels.modes.sumo_duel.winstreaks.best = handleSection(model.stats.Duels.modes.sumo_duel.winstreaks.best, best_winstreak_mode_sumo_duel);792 model.stats.Duels.modes.sumo_duel.winstreaks.current = handleSection(model.stats.Duels.modes.sumo_duel.winstreaks.current, current_winstreak_mode_sumo_duel);793 model.stats.Duels.modes.sumo_duel.swings = handleSection(model.stats.Duels.modes.sumo_duel.swings, sumo_duel_melee_swings);794 model.stats.Duels.modes.sumo_duel.hits = handleSection(model.stats.Duels.modes.sumo_duel.hits, sumo_duel_melee_hits);795 model.stats.Duels.modes.sumo_duel.arrowsShot = handleSection(model.stats.Duels.modes.sumo_duel.arrowsShot, sumo_duel_bow_shots);796 model.stats.Duels.modes.sumo_duel.arrowsHit = handleSection(model.stats.Duels.modes.sumo_duel.arrowsHit, sumo_duel_bow_hits);797 model.stats.Duels.modes.bowspleef_duel.division = getDivision('tnt_games');798 // Bowspleef 1v1799 model.stats.Duels.modes.bowspleef_duel.kills = handleSection(model.stats.Duels.modes.bowspleef_duel.kills, bowspleef_duel_kills);800 model.stats.Duels.modes.bowspleef_duel.deaths = handleSection(model.stats.Duels.modes.bowspleef_duel.deaths, bowspleef_duel_deaths);801 model.stats.Duels.modes.bowspleef_duel.wins = handleSection(model.stats.Duels.modes.bowspleef_duel.wins, bowspleef_duel_wins);802 model.stats.Duels.modes.bowspleef_duel.losses = handleSection(model.stats.Duels.modes.bowspleef_duel.losses, bowspleef_duel_losses);803 model.stats.Duels.modes.bowspleef_duel.winstreaks.best = handleSection(model.stats.Duels.modes.bowspleef_duel.winstreaks.best, best_winstreak_mode_bowspleef_duel);804 model.stats.Duels.modes.bowspleef_duel.winstreaks.current = handleSection(model.stats.Duels.modes.bowspleef_duel.winstreaks.current, current_winstreak_mode_bowspleef_duel);805 model.stats.Duels.modes.bowspleef_duel.swings = handleSection(model.stats.Duels.modes.bowspleef_duel.swings, bowspleef_duel_melee_swings);806 model.stats.Duels.modes.bowspleef_duel.hits = handleSection(model.stats.Duels.modes.bowspleef_duel.hits, bowspleef_duel_melee_hits);807 model.stats.Duels.modes.bowspleef_duel.arrowsShot = handleSection(model.stats.Duels.modes.bowspleef_duel.arrowsShot, bowspleef_duel_bow_shots);808 model.stats.Duels.modes.bowspleef_duel.arrowsHit = handleSection(model.stats.Duels.modes.bowspleef_duel.arrowsHit, bowspleef_duel_bow_hits);809 model.stats.Duels.modes.classic_duel.division = getDivision('classic');810 // Classic 1v1811 model.stats.Duels.modes.classic_duel.kills = handleSection(model.stats.Duels.modes.classic_duel.kills, classic_duel_kills);812 model.stats.Duels.modes.classic_duel.deaths = handleSection(model.stats.Duels.modes.classic_duel.deaths, classic_duel_deaths);813 model.stats.Duels.modes.classic_duel.wins = handleSection(model.stats.Duels.modes.classic_duel.wins, classic_duel_wins);814 model.stats.Duels.modes.classic_duel.losses = handleSection(model.stats.Duels.modes.classic_duel.losses, classic_duel_losses);815 model.stats.Duels.modes.classic_duel.winstreaks.best = handleSection(model.stats.Duels.modes.classic_duel.winstreaks.best, best_winstreak_mode_classic_duel);816 model.stats.Duels.modes.classic_duel.winstreaks.current = handleSection(model.stats.Duels.modes.classic_duel.winstreaks.current, current_winstreak_mode_classic_duel);817 model.stats.Duels.modes.classic_duel.swings = handleSection(model.stats.Duels.modes.classic_duel.swings, classic_duel_melee_swings);818 model.stats.Duels.modes.classic_duel.hits = handleSection(model.stats.Duels.modes.classic_duel.hits, classic_duel_melee_hits);819 model.stats.Duels.modes.classic_duel.arrowsShot = handleSection(model.stats.Duels.modes.classic_duel.arrowsShot, classic_duel_bow_shots);820 model.stats.Duels.modes.classic_duel.arrowsHit = handleSection(model.stats.Duels.modes.classic_duel.arrowsHit, classic_duel_bow_hits);821 model.stats.Duels.modes.potion_duel.division = getDivision('no_debuff');822 // Potion 1v1823 model.stats.Duels.modes.potion_duel.kills = handleSection(model.stats.Duels.modes.potion_duel.kills, potion_duel_kills);824 model.stats.Duels.modes.potion_duel.deaths = handleSection(model.stats.Duels.modes.potion_duel.deaths, potion_duel_deaths);825 model.stats.Duels.modes.potion_duel.wins = handleSection(model.stats.Duels.modes.potion_duel.wins, potion_duel_wins);826 model.stats.Duels.modes.potion_duel.losses = handleSection(model.stats.Duels.modes.potion_duel.losses, potion_duel_losses);827 model.stats.Duels.modes.potion_duel.winstreaks.best = handleSection(model.stats.Duels.modes.potion_duel.winstreaks.best, best_winstreak_mode_potion_duel);828 model.stats.Duels.modes.potion_duel.winstreaks.current = handleSection(model.stats.Duels.modes.potion_duel.winstreaks.current, current_winstreak_mode_potion_duel);829 model.stats.Duels.modes.potion_duel.swings = handleSection(model.stats.Duels.modes.potion_duel.swings, potion_duel_melee_swings);830 model.stats.Duels.modes.potion_duel.hits = handleSection(model.stats.Duels.modes.potion_duel.hits, potion_duel_melee_hits);831 model.stats.Duels.modes.potion_duel.arrowsShot = handleSection(model.stats.Duels.modes.potion_duel.arrowsShot, potion_duel_bow_shots);832 model.stats.Duels.modes.potion_duel.arrowsHit = handleSection(model.stats.Duels.modes.potion_duel.arrowsHit, potion_duel_bow_hits);833 model.stats.Duels.modes.combo_duel.division = getDivision('combo');834 // Combo 1v1835 model.stats.Duels.modes.combo_duel.kills = handleSection(model.stats.Duels.modes.combo_duel.kills, combo_duel_kills);836 model.stats.Duels.modes.combo_duel.deaths = handleSection(model.stats.Duels.modes.combo_duel.deaths, combo_duel_deaths);837 model.stats.Duels.modes.combo_duel.wins = handleSection(model.stats.Duels.modes.combo_duel.wins, combo_duel_wins);838 model.stats.Duels.modes.combo_duel.losses = handleSection(model.stats.Duels.modes.combo_duel.losses, combo_duel_losses);839 model.stats.Duels.modes.combo_duel.winstreaks.best = handleSection(model.stats.Duels.modes.combo_duel.winstreaks.best, best_winstreak_mode_combo_duel);840 model.stats.Duels.modes.combo_duel.winstreaks.current = handleSection(model.stats.Duels.modes.combo_duel.winstreaks.current, current_winstreak_mode_combo_duel);841 model.stats.Duels.modes.combo_duel.swings = handleSection(model.stats.Duels.modes.combo_duel.swings, combo_duel_melee_swings);842 model.stats.Duels.modes.combo_duel.hits = handleSection(model.stats.Duels.modes.combo_duel.hits, combo_duel_melee_hits);843 model.stats.Duels.modes.combo_duel.arrowsShot = handleSection(model.stats.Duels.modes.combo_duel.arrowsShot, combo_duel_bow_shots);844 model.stats.Duels.modes.combo_duel.arrowsHit = handleSection(model.stats.Duels.modes.combo_duel.arrowsHit, combo_duel_bow_hits);845 model.stats.Duels.bridgeModes.bridge_duel.division = getDivision('bridge');846 // BRIDGE847 model.stats.Duels.bridgeModes.bridge_duel.kills = handleSection(model.stats.Duels.bridgeModes.bridge_duel.kills, (bridge_duel_kills + bridge_duel_bridge_kills));848 model.stats.Duels.bridgeModes.bridge_duel.deaths = handleSection(model.stats.Duels.bridgeModes.bridge_duel.deaths, (bridge_duel_deaths + bridge_duel_bridge_deaths));849 model.stats.Duels.bridgeModes.bridge_duel.wins = handleSection(model.stats.Duels.bridgeModes.bridge_duel.wins, bridge_duel_wins);850 model.stats.Duels.bridgeModes.bridge_duel.losses = handleSection(model.stats.Duels.bridgeModes.bridge_duel.losses, bridge_duel_losses);851 model.stats.Duels.bridgeModes.bridge_duel.goals = handleSection(model.stats.Duels.bridgeModes.bridge_duel.goals, bridge_duel_goals);852 model.stats.Duels.bridgeModes.bridge_duel.swings = handleSection(model.stats.Duels.bridgeModes.bridge_duel.swings, bridge_duel_melee_swings);853 model.stats.Duels.bridgeModes.bridge_duel.hits = handleSection(model.stats.Duels.bridgeModes.bridge_duel.hits, bridge_duel_melee_hits);854 model.stats.Duels.bridgeModes.bridge_duel.arrowsShot = handleSection(model.stats.Duels.bridgeModes.bridge_duel.arrowsShot, bridge_duel_bow_shots);855 model.stats.Duels.bridgeModes.bridge_duel.arrowsHit = handleSection(model.stats.Duels.bridgeModes.bridge_duel.arrowsHit, bridge_duel_bow_hits);856 model.stats.Duels.bridgeModes.bridge_duel.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.bridge_duel.winstreaks.best, best_winstreak_mode_bridge_duel);857 model.stats.Duels.bridgeModes.bridge_duel.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.bridge_duel.winstreaks.current, current_winstreak_mode_bridge_duel);858 model.stats.Duels.bridgeModes.bridge_doubles.kills = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.kills, (bridge_doubles_kills + bridge_doubles_bridge_kills));859 model.stats.Duels.bridgeModes.bridge_doubles.deaths = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.deaths, (bridge_doubles_deaths + bridge_doubles_bridge_deaths));860 model.stats.Duels.bridgeModes.bridge_doubles.wins = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.wins, bridge_doubles_wins);861 model.stats.Duels.bridgeModes.bridge_doubles.losses = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.losses, bridge_doubles_losses);862 model.stats.Duels.bridgeModes.bridge_doubles.goals = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.goals, bridge_doubles_goals);863 model.stats.Duels.bridgeModes.bridge_doubles.swings = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.swings, bridge_doubles_melee_swings);864 model.stats.Duels.bridgeModes.bridge_doubles.hits = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.hits, bridge_doubles_melee_hits);865 model.stats.Duels.bridgeModes.bridge_doubles.arrowsShot = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.arrowsShot, bridge_doubles_bow_shots);866 model.stats.Duels.bridgeModes.bridge_doubles.arrowsHit = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.arrowsHit, bridge_doubles_bow_hits);867 model.stats.Duels.bridgeModes.bridge_doubles.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.winstreaks.best, best_winstreak_mode_bridge_doubles);868 model.stats.Duels.bridgeModes.bridge_doubles.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.bridge_doubles.winstreaks.current, current_winstreak_mode_bridge_doubles);869 model.stats.Duels.bridgeModes.bridge_threes.kills = handleSection(model.stats.Duels.bridgeModes.bridge_threes.kills, (bridge_threes_kills + bridge_threes_bridge_kills));870 model.stats.Duels.bridgeModes.bridge_threes.deaths = handleSection(model.stats.Duels.bridgeModes.bridge_threes.deaths, (bridge_threes_deaths + bridge_threes_bridge_deaths));871 model.stats.Duels.bridgeModes.bridge_threes.wins = handleSection(model.stats.Duels.bridgeModes.bridge_threes.wins, bridge_threes_wins);872 model.stats.Duels.bridgeModes.bridge_threes.losses = handleSection(model.stats.Duels.bridgeModes.bridge_threes.losses, bridge_threes_losses);873 model.stats.Duels.bridgeModes.bridge_threes.goals = handleSection(model.stats.Duels.bridgeModes.bridge_threes.goals, bridge_threes_goals);874 model.stats.Duels.bridgeModes.bridge_threes.swings = handleSection(model.stats.Duels.bridgeModes.bridge_threes.swings, bridge_threes_melee_swings);875 model.stats.Duels.bridgeModes.bridge_threes.hits = handleSection(model.stats.Duels.bridgeModes.bridge_threes.hits, bridge_threes_melee_hits);876 model.stats.Duels.bridgeModes.bridge_threes.arrowsShot = handleSection(model.stats.Duels.bridgeModes.bridge_threes.arrowsShot, bridge_threes_bow_shots);877 model.stats.Duels.bridgeModes.bridge_threes.arrowsHit = handleSection(model.stats.Duels.bridgeModes.bridge_threes.arrowsHit, bridge_threes_bow_hits);878 model.stats.Duels.bridgeModes.bridge_threes.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.bridge_threes.winstreaks.best, best_winstreak_mode_bridge_threes);879 model.stats.Duels.bridgeModes.bridge_threes.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.bridge_threes.winstreaks.current, current_winstreak_mode_bridge_threes);880 model.stats.Duels.bridgeModes.bridge_four.kills = handleSection(model.stats.Duels.bridgeModes.bridge_four.kills, (bridge_four_kills + bridge_four_bridge_kills));881 model.stats.Duels.bridgeModes.bridge_four.deaths = handleSection(model.stats.Duels.bridgeModes.bridge_four.deaths, (bridge_four_deaths + bridge_four_bridge_deaths));882 model.stats.Duels.bridgeModes.bridge_four.wins = handleSection(model.stats.Duels.bridgeModes.bridge_four.wins, bridge_four_wins);883 model.stats.Duels.bridgeModes.bridge_four.losses = handleSection(model.stats.Duels.bridgeModes.bridge_four.losses, bridge_four_losses);884 model.stats.Duels.bridgeModes.bridge_four.goals = handleSection(model.stats.Duels.bridgeModes.bridge_four.goals, bridge_four_goals);885 model.stats.Duels.bridgeModes.bridge_four.swings = handleSection(model.stats.Duels.bridgeModes.bridge_four.swings, bridge_four_melee_swings);886 model.stats.Duels.bridgeModes.bridge_four.hits = handleSection(model.stats.Duels.bridgeModes.bridge_four.hits, bridge_four_melee_hits);887 model.stats.Duels.bridgeModes.bridge_four.arrowsShot = handleSection(model.stats.Duels.bridgeModes.bridge_four.arrowsShot, bridge_four_bow_shots);888 model.stats.Duels.bridgeModes.bridge_four.arrowsHit = handleSection(model.stats.Duels.bridgeModes.bridge_four.arrowsHit, bridge_four_bow_hits);889 model.stats.Duels.bridgeModes.bridge_four.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.bridge_four.winstreaks.best, best_winstreak_mode_bridge_four);890 model.stats.Duels.bridgeModes.bridge_four.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.bridge_four.winstreaks.current, current_winstreak_mode_bridge_four);891 model.stats.Duels.bridgeModes.bridge_2v2v2v2.kills = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.kills, (bridge_2v2v2v2_kills + bridge_2v2v2v2_bridge_kills));892 model.stats.Duels.bridgeModes.bridge_2v2v2v2.deaths = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.deaths, (bridge_2v2v2v2_deaths + bridge_2v2v2v2_bridge_deaths));893 model.stats.Duels.bridgeModes.bridge_2v2v2v2.wins = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.wins, bridge_2v2v2v2_wins);894 model.stats.Duels.bridgeModes.bridge_2v2v2v2.losses = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.losses, bridge_2v2v2v2_losses);895 model.stats.Duels.bridgeModes.bridge_2v2v2v2.goals = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.goals, bridge_2v2v2v2_goals);896 model.stats.Duels.bridgeModes.bridge_2v2v2v2.swings = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.swings, bridge_2v2v2v2_melee_swings);897 model.stats.Duels.bridgeModes.bridge_2v2v2v2.hits = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.hits, bridge_2v2v2v2_melee_hits);898 model.stats.Duels.bridgeModes.bridge_2v2v2v2.arrowsShot = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.arrowsShot, bridge_2v2v2v2_bow_shots);899 model.stats.Duels.bridgeModes.bridge_2v2v2v2.arrowsHit = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.arrowsHit, bridge_2v2v2v2_bow_hits);900 model.stats.Duels.bridgeModes.bridge_2v2v2v2.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.winstreaks.best, best_winstreak_mode_bridge_2v2v2v2);901 model.stats.Duels.bridgeModes.bridge_2v2v2v2.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.bridge_2v2v2v2.winstreaks.current, current_winstreak_mode_bridge_2v2v2v2);902 model.stats.Duels.bridgeModes.bridge_3v3v3v3.kills = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.kills, (bridge_3v3v3v3_kills + bridge_3v3v3v3_bridge_kills));903 model.stats.Duels.bridgeModes.bridge_3v3v3v3.deaths = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.deaths, (bridge_3v3v3v3_deaths + bridge_3v3v3v3_bridge_deaths));904 model.stats.Duels.bridgeModes.bridge_3v3v3v3.wins = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.wins, bridge_3v3v3v3_wins);905 model.stats.Duels.bridgeModes.bridge_3v3v3v3.losses = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.losses, bridge_3v3v3v3_losses);906 model.stats.Duels.bridgeModes.bridge_3v3v3v3.goals = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.goals, bridge_3v3v3v3_goals);907 model.stats.Duels.bridgeModes.bridge_3v3v3v3.swings = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.swings, bridge_3v3v3v3_melee_swings);908 model.stats.Duels.bridgeModes.bridge_3v3v3v3.hits = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.hits, bridge_3v3v3v3_melee_hits);909 model.stats.Duels.bridgeModes.bridge_3v3v3v3.arrowsShot = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.arrowsShot, bridge_3v3v3v3_bow_shots);910 model.stats.Duels.bridgeModes.bridge_3v3v3v3.arrowsHit = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.arrowsHit, bridge_3v3v3v3_bow_hits);911 model.stats.Duels.bridgeModes.bridge_3v3v3v3.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.winstreaks.best, best_winstreak_mode_bridge_3v3v3v3);912 model.stats.Duels.bridgeModes.bridge_3v3v3v3.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.bridge_3v3v3v3.winstreaks.current, current_winstreak_mode_bridge_3v3v3v3);913 model.stats.Duels.bridgeModes.capture_threes.kills = handleSection(model.stats.Duels.bridgeModes.capture_threes.kills, (capture_threes_kills + capture_threes_bridge_kills));914 model.stats.Duels.bridgeModes.capture_threes.deaths = handleSection(model.stats.Duels.bridgeModes.capture_threes.deaths, (capture_threes_deaths + capture_threes_bridge_deaths));915 model.stats.Duels.bridgeModes.capture_threes.wins = handleSection(model.stats.Duels.bridgeModes.capture_threes.wins, capture_threes_wins);916 model.stats.Duels.bridgeModes.capture_threes.losses = handleSection(model.stats.Duels.bridgeModes.capture_threes.losses, capture_threes_losses);917 model.stats.Duels.bridgeModes.capture_threes.goals = handleSection(model.stats.Duels.bridgeModes.capture_threes.goals, capture_threes_goals);918 model.stats.Duels.bridgeModes.capture_threes.swings = handleSection(model.stats.Duels.bridgeModes.capture_threes.swings, capture_threes_melee_swings);919 model.stats.Duels.bridgeModes.capture_threes.hits = handleSection(model.stats.Duels.bridgeModes.capture_threes.hits, capture_threes_melee_hits);920 model.stats.Duels.bridgeModes.capture_threes.arrowsShot = handleSection(model.stats.Duels.bridgeModes.capture_threes.arrowsShot, capture_threes_bow_shots);921 model.stats.Duels.bridgeModes.capture_threes.arrowsHit = handleSection(model.stats.Duels.bridgeModes.capture_threes.arrowsHit, capture_threes_bow_hits);922 model.stats.Duels.bridgeModes.capture_threes.winstreaks.best = handleSection(model.stats.Duels.bridgeModes.capture_threes.winstreaks.best, best_winstreak_mode_capture_threes);923 model.stats.Duels.bridgeModes.capture_threes.winstreaks.current = handleSection(model.stats.Duels.bridgeModes.capture_threes.winstreaks.current, current_winstreak_mode_capture_threes);924 type Keyable = {925 [key: string]: string | number | undefined926 }927 function getDivision(duelType: string) {928 // stolen from 25karma.xys (thank u <3)929 for (const div of divisions.slice().reverse()) {930 let dat = divisionData[`${duelType}_${div.id}_title_prestige`];931 if (dat !== undefined) {932 if (typeof dat === 'string') dat = parseInt(dat);933 return {934 name: `${div.name} ${romanize(dat)}`,935 level: romanize(dat).toString(),936 color: div.color,937 }938 }939 }940 return {941 name: `-`,942 level: `-`,943 color: 'gray'944 }945 }946 function handleArray(array: Array<HypixelStat>, val: number | string): Array<HypixelStat> {947 if (!array.some(e => e.value === val)) {948 array.push({949 value: val,950 date: new Date(),951 });952 }953 return array;954 }955 function handleSection(location: HypixelSection, value: number | string): HypixelSection {956 return {957 value: value,958 history: handleArray(location.history, value)959 }960 }961 return model;...
TNTGames.game.ts
Source:TNTGames.game.ts
...83 new_witherwizard_regen = 0,84}): IHypixel => {85 // someone please optimize this im too dumb with typescript !!!!!!!!!!!!!!!! HELPPPP !!!!!!!!!!86 // GAME STATS87 model.stats.TNTGames.coins = handleSection(model.stats.TNTGames.coins, coins);88 model.stats.TNTGames.wins = handleSection(model.stats.TNTGames.wins, wins);89 // TNT Tag90 model.stats.TNTGames.modes.tnt_tag.deaths = handleSection(model.stats.TNTGames.modes.tnt_tag.deaths, deaths_tntag);91 model.stats.TNTGames.modes.tnt_tag.kills = handleSection(model.stats.TNTGames.modes.tnt_tag.kills, kills_tntag);92 model.stats.TNTGames.modes.tnt_tag.wins = handleSection(model.stats.TNTGames.modes.tnt_tag.wins, wins_tntag);93 // TNT Run94 model.stats.TNTGames.modes.tnt_run.deaths = handleSection(model.stats.TNTGames.modes.tnt_run.deaths, deaths_tntrun);95 model.stats.TNTGames.modes.tnt_run.wins = handleSection(model.stats.TNTGames.modes.tnt_run.wins, wins_tntrun);96 model.stats.TNTGames.modes.tnt_run.record = handleSection(model.stats.TNTGames.modes.tnt_run.record, record_tntrun);97 // PVP Run98 model.stats.TNTGames.modes.pvp_run.deaths = handleSection(model.stats.TNTGames.modes.pvp_run.deaths, deaths_pvprun);99 model.stats.TNTGames.modes.pvp_run.kills = handleSection(model.stats.TNTGames.modes.pvp_run.kills, kills_pvprun);100 model.stats.TNTGames.modes.pvp_run.wins = handleSection(model.stats.TNTGames.modes.pvp_run.wins, wins_pvprun);101 model.stats.TNTGames.modes.pvp_run.record = handleSection(model.stats.TNTGames.modes.pvp_run.record, record_pvprun);102 // Bow Spleef103 model.stats.TNTGames.modes.bow_spleef.deaths = handleSection(model.stats.TNTGames.modes.bow_spleef.deaths, deaths_bowspleef);104 model.stats.TNTGames.modes.bow_spleef.wins = handleSection(model.stats.TNTGames.modes.bow_spleef.wins, wins_bowspleef);105 model.stats.TNTGames.modes.bow_spleef.tags = handleSection(model.stats.TNTGames.modes.bow_spleef.tags, tags_bowspleef);106 // Wizards107 model.stats.TNTGames.modes.wizards.wins = handleSection(model.stats.TNTGames.modes.wizards.wins, wins_capture);108 model.stats.TNTGames.modes.wizards.kills = handleSection(model.stats.TNTGames.modes.wizards.kills, kills_capture);109 model.stats.TNTGames.modes.wizards.deaths = handleSection(model.stats.TNTGames.modes.wizards.deaths, deaths_capture);110 model.stats.TNTGames.modes.wizards.assists = handleSection(model.stats.TNTGames.modes.wizards.assists, assists_capture);111 if(capture_class) model.stats.TNTGames.modes.wizards.classes.current = capture_class;112 // Ancient Class113 model.stats.TNTGames.modes.wizards.classes.ancient.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.ancient.kills, new_ancientwizard_kills);114 model.stats.TNTGames.modes.wizards.classes.ancient.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.ancient.deaths, new_ancientwizard_deaths);115 model.stats.TNTGames.modes.wizards.classes.ancient.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.ancient.assists, new_ancientwizard_assists);116 model.stats.TNTGames.modes.wizards.classes.ancient.power = handleSection(model.stats.TNTGames.modes.wizards.classes.ancient.power, new_ancientwizard_explode);117 model.stats.TNTGames.modes.wizards.classes.ancient.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.ancient.regen, new_ancientwizard_regen);118 // Blood Class119 model.stats.TNTGames.modes.wizards.classes.blood.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.blood.kills, new_bloodwizard_kills);120 model.stats.TNTGames.modes.wizards.classes.blood.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.blood.deaths, new_bloodwizard_deaths);121 model.stats.TNTGames.modes.wizards.classes.blood.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.blood.assists, new_bloodwizard_assists);122 model.stats.TNTGames.modes.wizards.classes.blood.power = handleSection(model.stats.TNTGames.modes.wizards.classes.blood.power, new_bloodwizard_explode);123 model.stats.TNTGames.modes.wizards.classes.blood.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.blood.regen, new_bloodwizard_regen);124 // Fire Class125 model.stats.TNTGames.modes.wizards.classes.fire.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.fire.kills, new_firewizard_kills);126 model.stats.TNTGames.modes.wizards.classes.fire.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.fire.deaths, new_firewizard_deaths);127 model.stats.TNTGames.modes.wizards.classes.fire.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.fire.assists, new_firewizard_assists);128 model.stats.TNTGames.modes.wizards.classes.fire.power = handleSection(model.stats.TNTGames.modes.wizards.classes.fire.power, new_firewizard_explode);129 model.stats.TNTGames.modes.wizards.classes.fire.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.fire.regen, new_firewizard_regen);130 // Hydro Class131 model.stats.TNTGames.modes.wizards.classes.hydro.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.hydro.kills, new_hydrowizard_kills);132 model.stats.TNTGames.modes.wizards.classes.hydro.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.hydro.deaths, new_hydrowizard_deaths);133 model.stats.TNTGames.modes.wizards.classes.hydro.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.hydro.assists, new_hydrowizard_assists);134 model.stats.TNTGames.modes.wizards.classes.hydro.power = handleSection(model.stats.TNTGames.modes.wizards.classes.hydro.power, new_hydrowizard_explode);135 model.stats.TNTGames.modes.wizards.classes.hydro.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.hydro.regen, new_hydrowizard_regen);136 // Ice Class137 model.stats.TNTGames.modes.wizards.classes.ice.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.ice.kills, new_icewizard_kills);138 model.stats.TNTGames.modes.wizards.classes.ice.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.ice.deaths, new_icewizard_deaths);139 model.stats.TNTGames.modes.wizards.classes.ice.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.ice.assists, new_icewizard_assists);140 model.stats.TNTGames.modes.wizards.classes.ice.power = handleSection(model.stats.TNTGames.modes.wizards.classes.ice.power, new_icewizard_explode);141 model.stats.TNTGames.modes.wizards.classes.ice.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.ice.regen, new_icewizard_regen);142 // Kinetic Class143 model.stats.TNTGames.modes.wizards.classes.kinetic.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.kinetic.kills, new_kineticwizard_kills);144 model.stats.TNTGames.modes.wizards.classes.kinetic.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.kinetic.deaths, new_kineticwizard_deaths);145 model.stats.TNTGames.modes.wizards.classes.kinetic.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.kinetic.assists, new_kineticwizard_assists);146 model.stats.TNTGames.modes.wizards.classes.kinetic.power = handleSection(model.stats.TNTGames.modes.wizards.classes.kinetic.power, new_kineticwizard_explode);147 model.stats.TNTGames.modes.wizards.classes.kinetic.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.kinetic.regen, new_kineticwizard_regen);148 // Storm Class149 model.stats.TNTGames.modes.wizards.classes.storm.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.storm.kills, new_stormwizard_kills);150 model.stats.TNTGames.modes.wizards.classes.storm.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.storm.deaths, new_stormwizard_deaths);151 model.stats.TNTGames.modes.wizards.classes.storm.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.storm.assists, new_stormwizard_assists);152 model.stats.TNTGames.modes.wizards.classes.storm.power = handleSection(model.stats.TNTGames.modes.wizards.classes.storm.power, new_stormwizard_explode);153 model.stats.TNTGames.modes.wizards.classes.storm.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.storm.regen, new_stormwizard_regen);154 // Toxic Class155 model.stats.TNTGames.modes.wizards.classes.toxic.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.toxic.kills, new_toxicwizard_kills);156 model.stats.TNTGames.modes.wizards.classes.toxic.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.toxic.deaths, new_toxicwizard_deaths);157 model.stats.TNTGames.modes.wizards.classes.toxic.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.toxic.assists, new_toxicwizard_assists);158 model.stats.TNTGames.modes.wizards.classes.toxic.power = handleSection(model.stats.TNTGames.modes.wizards.classes.toxic.power, new_toxicwizard_explode);159 model.stats.TNTGames.modes.wizards.classes.toxic.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.toxic.regen, new_toxicwizard_regen);160 // Wither Class161 model.stats.TNTGames.modes.wizards.classes.wither.kills = handleSection(model.stats.TNTGames.modes.wizards.classes.wither.kills, new_witherwizard_kills);162 model.stats.TNTGames.modes.wizards.classes.wither.deaths = handleSection(model.stats.TNTGames.modes.wizards.classes.wither.deaths, new_witherwizard_deaths);163 model.stats.TNTGames.modes.wizards.classes.wither.assists = handleSection(model.stats.TNTGames.modes.wizards.classes.wither.assists, new_witherwizard_assists);164 model.stats.TNTGames.modes.wizards.classes.wither.power = handleSection(model.stats.TNTGames.modes.wizards.classes.wither.power, new_witherwizard_explode);165 model.stats.TNTGames.modes.wizards.classes.wither.regen = handleSection(model.stats.TNTGames.modes.wizards.classes.wither.regen, new_witherwizard_regen);166 function handleArray(array: Array<HypixelStat>, val: number | string): Array<HypixelStat> {167 if (!array.some(e => e.value === val)) {168 array.push({169 value: val,170 date: new Date(),171 });172 }173 return array;174 }175 function handleSection(location: HypixelSection, value: number | string): HypixelSection {176 return {177 value: value,178 history: handleArray(location.history, value)179 }180 }181 return model;...
App.js
Source:App.js
...16 });17 const [board, setBoard] = useState([]);18 const [game, setGame] = useState('')19 const [availableConditions, setAvailableConditions] = useState()20 function handleSection(e) {21 const { name, value, type } = e.target;22 setSections((prevSections) => ({ ...prevSections, [name]: { dir: prevSections[name].dir, value }}))23 }24 function handleSelect(e) {25 const { name, value } = e.target;26 setSections((prevSections) => ({ ...prevSections, [name]: { value: prevSections[name].value, dir: value }}))27 }28 function createBoard() {29 if (!game) {30 const { first, second, third, fourth, fifth, sixth } = sections;31 const game = new StartGame(first, second, third, fourth, fifth, sixth, 5);32 setGame(game);33 setBoard(game.getBoard());34 }...
Using AI Code Generation
1import {handleSection} from 'ng-mocks';2import {MockBuilder} from 'ng-mocks';3import {MockRender} from 'ng-mocks';4import {MockInstance} from 'ng-mocks';5import {MockProvider} from 'ng-mocks';6describe('TestComponent', () => {7 let component: TestComponent;8 let fixture: ComponentFixture<TestComponent>;9 beforeEach(() => {10 MockBuilder(TestComponent);11 MockRender(TestComponent);12 MockInstance(TestComponent);13 MockProvider(TestComponent);14 handleSection(TestComponent);15 MockBuilder(TestComponent, MyModule);16 MockRender(TestComponent, MyModule);17 MockInstance(TestComponent, MyModule);18 MockProvider(TestComponent, MyModule);19 handleSection(TestComponent, MyModule);20 });21 MockBuilder(TestComponent, MyModule, MyModule2);22 MockRender(TestComponent, MyModule, MyModule2);23 MockInstance(TestComponent, MyModule, MyModule2);24 MockProvider(TestComponent, MyModule, MyModule2);25 handleSection(TestComponent, MyModule, MyModule2);26 MockBuilder(TestComponent, MyModule, MyModule2, MyModule3);
Using AI Code Generation
1import { handleSection } from 'ng-mocks';2import { handleSection } from 'ng-mocks';3import { handleSection } from 'ng-mocks';4import { handleSection } from 'ng-mocks';5import { handleSection } from 'ng-mocks';6import { handleSection } from 'ng-mocks';7import { handleSection } from 'ng-mocks';8import { handleSection } from 'ng-mocks';9import { handleSection } from 'ng-mocks';10import { handleSection } from 'ng-mocks';11import { handleSection } from 'ng-mocks';12import { handleSection } from 'ng-mocks';13import { handleSection } from 'ng-mocks';14import { handleSection } from 'ng-mocks';15import { handleSection } from 'ng-mocks';16import { handleSection } from 'ng-mocks';17import { handleSection } from 'ng-mocks';18import { handleSection } from 'ng-mocks';19import { handleSection } from 'ng-mocks';20import { handleSection } from 'ng
Using AI Code Generation
1import { handleSection } from 'ng-mocks';2import { MyComponent } from './my.component';3describe('MyComponent', () => {4 it('should render', () => {5 const fixture = handleSection(MyComponent);6 expect(fixture.nativeElement).toMatchSnapshot();7 });8});9import { handleSection } from 'ng-mocks';10import { MyComponent } from './my.component';11describe('MyComponent', () => {12 it('should render', () => {13 const fixture = handleSection(MyComponent);14 expect(fixture.nativeElement).toMatchSnapshot();15 });16});17import { Component } from '@angular/core';18@Component({19})20export class MyComponent {}21import { NgModule } from '@angular/core';22import { CommonModule } from '@angular/common';23import { MyComponent } from './my.component';24@NgModule({25 imports: [CommonModule],26})27export class MyModule {}28import { handleSection } from 'ng-mocks';29import { MyModule } from './my.module';30describe('MyModule', () => {31 it('should render', () => {32 const fixture = handleSection(MyModule);33 expect(fixture.nativeElement).toMatchSnapshot();34 });35});36import { NgModule } from '@angular/core';37import { CommonModule } from '@angular/common';38import { MyComponent } from './my.component';39@NgModule({40 imports: [CommonModule],41})42export class MyModule {}43import { handleSection }
Using AI Code Generation
1import { handleSection } from 'ng-mocks';2describe('test', () => {3 it('test', () => {4 const fixture = TestBed.createComponent(AppComponent);5 const comp = fixture.componentInstance;6 const section = handleSection(comp, 'sectionName');7 expect(section).toBeTruthy();8 });9});10import { handleSection } from 'ng-mocks';11describe('test', () => {12 it('test', () => {13 const fixture = TestBed.createComponent(AppComponent);14 const comp = fixture.componentInstance;15 const section = handleSection(comp, 'sectionName');16 expect(section).toBeTruthy();17 });18});19import { handleSection } from 'ng-mocks';20describe('test', () => {21 it('test', () => {22 const fixture = TestBed.createComponent(AppComponent);23 const comp = fixture.componentInstance;24 const section = handleSection(comp, 'sectionName');25 expect(section).toBeTruthy();26 });27});
Using AI Code Generation
1import { handleSection } from 'ng-mocks';2import { MyDirective } from 'my-directive';3describe('MyDirective', () => {4 it('should render the directive', () => {5 const fixture = handleSection(MyDirective);6 expect(fixture.nativeElement.innerHTML).toContain('My Directive');7 });8});9import { handleComponent } from 'ng-mocks';10import { MyComponent } from 'my-component';11describe('MyComponent', () => {12 it('should render the component', () => {13 const fixture = handleComponent(MyComponent);14 expect(fixture.nativeElement.innerHTML).toContain('My Component');15 });16});17import { handleService } from 'ng-mocks';18import { MyService } from 'my-service';19describe('MyService', () => {20 it('should render the service', () => {21 const fixture = handleService(MyService);22 expect(fixture.nativeElement.innerHTML).toContain('My Service');23 });24});25import { handlePipe } from 'ng-mocks';26import { MyPipe } from 'my-pipe';27describe('MyPipe', () => {28 it('should render the pipe', () => {29 const fixture = handlePipe(MyPipe);30 expect(fixture.nativeElement.innerHTML).toContain('My Pipe');31 });32});
Using AI Code Generation
1var ngMocks = require('ng-mocks');2describe('test', function () {3 var $rootScope, $compile, $templateCache;4 beforeEach(angular.mock.module('app'));5 beforeEach(angular.mock.inject(function (_$rootScope_, _$compile_, _$templateCache_) {6 $rootScope = _$rootScope_;7 $compile = _$compile_;8 $templateCache = _$templateCache_;9 }));10 it('test', function () {11 var $scope = $rootScope.$new();12 var html = '<section ng-mocks-handle-section><div><div></div></div></section>';13 var element = $compile(html)($scope);14 $scope.$digest();15 });16});17var ngMocks = require('ng-mocks');18describe('test', function () {19 var $rootScope, $compile, $templateCache;20 beforeEach(angular.mock.module('app'));21 beforeEach(angular.mock.inject(function (_$rootScope_, _$compile_, _$templateCache_) {22 $rootScope = _$rootScope_;23 $compile = _$compile_;24 $templateCache = _$templateCache_;25 }));26 it('test', function () {27 var $scope = $rootScope.$new();28 var html = '<section ng-mocks-handle-section><div><div></div></div></section>';29 var element = $compile(html)($scope);30 $scope.$digest();31 var div = element.find('div');32 expect(div.length).toBe(2);33 });34});
Using AI Code Generation
1import { handleSection } from 'ng-mocks';2const section = handleSection({3 imports: [BrowserModule],4});5section.detectChanges();6section.destroy();7section.fixture;8section.injector;9section.instance;10section.nativeElement;11section.query;12section.queryAll;13section.queryAllNodes;14section.queryNodes;15section.queryProvider;16section.queryProviders;17section.queryService;
Using AI Code Generation
1const mock = ngMocks.findInstance(SectionComponent);2mock.handleSection();3handleSection() {4 console.log('handleSection method called');5}6const mock = ngMocks.findInstance(SectionComponent);7mock.handleSection();8expect(mock.handleSection).toHaveBeenCalled();9handleSection() {10 console.log('handleSection method called');11}12const mock = ngMocks.findInstance(SectionComponent);13mock.handleSection();14expect(mock.handleSection).toHaveBeenCalled();15handleSection() {16 console.log('handleSection method called');17}18const mock = ngMocks.findInstance(SectionComponent);19mock.handleSection();20expect(mock.handleSection).toHaveBeenCalled();21handleSection() {22 console.log('handleSection method called');23}24const mock = ngMocks.findInstance(SectionComponent);25mock.handleSection();26expect(mock.handleSection).toHaveBeenCalled();27handleSection() {28 console.log('handleSection method called');29}30const mock = ngMocks.findInstance(SectionComponent);31mock.handleSection();32expect(mock.handleSection).toHaveBeenCalled();33handleSection() {34 console.log('handleSection method called');35}36const mock = ngMocks.findInstance(SectionComponent);37mock.handleSection();38expect(mock.handleSection).toHaveBeenCalled();39handleSection() {40 console.log('handleSection method called');41}
Using AI Code Generation
1const mock = ngMocks.findInstance(SectionComponent);2mock.handleSection();3handleSection() {4 this.sectionService.handleSection();5}6const mock = ngMocks.findInstance(SectionService);7mock.handleSection();8handleSection() {9 this.sectionService.handleSection();10}11const mock = TestBed.get(SectionService);12mock.handleSection();13handleSection() {14 this.sectionService.handleSection();15}16const mock = TestBed.get(SectionService);17mock.handleSection();18handleSection() {19 this.sectionService.handleSection();20}
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!