35 lines
1.3 KiB
Python
35 lines
1.3 KiB
Python
# Copyright 2024 Zoé Cassiopée Gauthier.
|
|
#
|
|
# Use of this source code is governed by an MIT-style
|
|
# license that can be found in the LICENSE file or at
|
|
# https://opensource.org/licenses/MIT.
|
|
|
|
import argparse
|
|
import operator
|
|
import sys
|
|
from functools import reduce
|
|
|
|
from pogo_scaled_estimators.calculator import Calculator, Filter
|
|
|
|
|
|
def main_cli():
|
|
parser = argparse.ArgumentParser()
|
|
_ = parser.add_argument("type", nargs="+", help="an attacker type")
|
|
_ = parser.add_argument("--level", type=int, default=40)
|
|
_ = parser.add_argument("--party", type=int, default=1)
|
|
_ = parser.add_argument("--no-legacy", dest="filters", action="append_const", const=Filter.DISALLOW_LEGACY_MOVES)
|
|
_ = parser.add_argument("--no-mega", dest="filters", action="append_const", const=Filter.DISALLOW_MEGA_POKEMON)
|
|
_ = parser.add_argument("--no-shadow", dest="filters", action="append_const", const=Filter.DISALLOW_SHADOW_POKEMON)
|
|
_ = parser.add_argument(
|
|
"--no-legendary", dest="filters", action="append_const", const=Filter.DISALLOW_LEGENDARY_POKEMON
|
|
)
|
|
|
|
args = parser.parse_args()
|
|
filters = reduce(operator.or_, args.filters, Filter.NO_FILTER)
|
|
calculator = Calculator(args.type, filters)
|
|
calculator.calculate(level=args.level, party=args.party)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main_cli())
|