diff --git a/cpp/main.cpp b/cpp/main.cpp index 0a26a61..a93e4e8 100644 --- a/cpp/main.cpp +++ b/cpp/main.cpp @@ -9,10 +9,10 @@ void init_constants() { std::unordered_map attacker_type_to_attributes; for (size_t i = 1; i <= Constants::NO_OF_ATTACKER_TYPES; i++) { - unsigned hp, range, attack_power, speed, price; - std::cin >> hp >> range >> attack_power >> speed >> price; + unsigned hp, range, attack_power, speed, price, is_aerial; + std::cin >> hp >> range >> attack_power >> speed >> price >> is_aerial; attacker_type_to_attributes.insert( - std::make_pair(i, Attributes(hp, range, attack_power, speed, price))); + std::make_pair(i, Attributes(hp, range, attack_power, speed, price, is_aerial))); } Constants::ATTACKER_TYPE_ATTRIBUTES = attacker_type_to_attributes; @@ -21,10 +21,10 @@ void init_constants() { std::unordered_map defender_type_to_attributes; for (size_t i = 1; i <= Constants::NO_OF_DEFENDER_TYPES; i++) { - unsigned hp, range, attack_power, speed, price; - std::cin >> hp >> range >> attack_power >> speed >> price; + unsigned hp, range, attack_power, speed, price, is_aerial; + std::cin >> hp >> range >> attack_power >> speed >> price >> is_aerial; defender_type_to_attributes.insert( - std::make_pair(i, Attributes(hp, range, attack_power, speed, price))); + std::make_pair(i, Attributes(hp, range, attack_power, speed, price, is_aerial))); } Constants::DEFENDER_TYPE_ATTRIBUTES = defender_type_to_attributes; } diff --git a/cpp/player_code.cpp b/cpp/player_code.cpp index 0ebfc4f..b091f9d 100644 --- a/cpp/player_code.cpp +++ b/cpp/player_code.cpp @@ -10,9 +10,9 @@ #include Attributes::Attributes(unsigned hp, unsigned range, unsigned attack_power, - unsigned speed, unsigned price) + unsigned speed, unsigned price, unsigned is_aerial) : hp(hp), range(range), attack_power(attack_power), speed(speed), - price(price) {} + price(price), is_aerial(is_aerial) {} Position::Position(int x, int y) : _x(x), _y(y) {} diff --git a/cpp/player_code.h b/cpp/player_code.h index 91e9c44..61dbd7a 100644 --- a/cpp/player_code.h +++ b/cpp/player_code.h @@ -13,8 +13,9 @@ struct Attributes { const unsigned attack_power; const unsigned speed; const unsigned price; + const unsigned is_aerial; Attributes(unsigned hp, unsigned range, unsigned attack_power, unsigned speed, - unsigned price); + unsigned price, unsigned is_aerial); }; struct Constants { diff --git a/java/Attributes.java b/java/Attributes.java index e83b17f..37bc3e1 100644 --- a/java/Attributes.java +++ b/java/Attributes.java @@ -4,12 +4,14 @@ public class Attributes { public final int attackPower; public final int speed; public final int price; + public final int is_aerial; - public Attributes(int hp, int range, int attackPower, int speed, int price) { + public Attributes(int hp, int range, int attackPower, int speed, int price, int is_aerial) { this.hp = hp; this.range = range; this.attackPower = attackPower; this.speed = speed; this.price = price; + this.is_aerial = is_aerial; } } diff --git a/java/Main.java b/java/Main.java index 82c1a3a..df9d162 100644 --- a/java/Main.java +++ b/java/Main.java @@ -74,14 +74,14 @@ public static void main(String[] args) { Constants.ATTACKER_TYPE_ATTRIBUTES = new HashMap(); for (int i = 1; i <= Constants.NO_OF_ATTACKER_TYPES; i++) { Constants.ATTACKER_TYPE_ATTRIBUTES.put(i, - new Attributes(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt())); + new Attributes(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt())); } Constants.NO_OF_DEFENDER_TYPES = in.nextInt(); Constants.DEFENDER_TYPE_ATTRIBUTES = new HashMap(); for (int i = 1; i <= Constants.NO_OF_DEFENDER_TYPES; i++) { Constants.DEFENDER_TYPE_ATTRIBUTES.put(i, - new Attributes(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt())); + new Attributes(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt())); } GameMap map = getInitialMap(); diff --git a/python/player_code.py b/python/player_code.py index 4a8a487..bd06341 100644 --- a/python/player_code.py +++ b/python/player_code.py @@ -17,6 +17,7 @@ class ActorType: range: int attack_power: int price: int + is_aerial: int @dataclass(frozen=True) @@ -98,17 +99,17 @@ def initialize(cls): cls.NO_OF_ATTACKER_TYPES = int(input()) cls.ATTACKER_TYPE_ATTRIBUTES = {} for i in range(1, cls.NO_OF_ATTACKER_TYPES + 1): - hp, a_range, attack_power, speed, price = map(int, input().split()) + hp, a_range, attack_power, speed, price, is_aerial = map(int, input().split()) cls.ATTACKER_TYPE_ATTRIBUTES[i] = AttackerType( - hp, a_range, attack_power, price, speed + hp, a_range, attack_power, price, is_aerial, speed ) cls.NO_OF_DEFENDER_TYPES = int(input()) cls.DEFENDER_TYPE_ATTRIBUTES = {} for i in range(1, cls.NO_OF_DEFENDER_TYPES + 1): - hp, d_range, attack_power, _, price = map(int, input().split()) + hp, d_range, attack_power, _, price, is_aerial = map(int, input().split()) cls.DEFENDER_TYPE_ATTRIBUTES[i] = DefenderType( - hp, d_range, attack_power, price + hp, d_range, attack_power, price, is_aerial )