Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ void init_constants() {

std::unordered_map<size_t, Attributes> 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;

Expand All @@ -21,10 +21,10 @@ void init_constants() {

std::unordered_map<size_t, Attributes> 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;
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/player_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include <vector>

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) {}

Expand Down
3 changes: 2 additions & 1 deletion cpp/player_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 3 additions & 1 deletion java/Attributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
4 changes: 2 additions & 2 deletions java/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ public static void main(String[] args) {
Constants.ATTACKER_TYPE_ATTRIBUTES = new HashMap<Integer, Attributes>();
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<Integer, Attributes>();
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();
Expand Down
9 changes: 5 additions & 4 deletions python/player_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ActorType:
range: int
attack_power: int
price: int
is_aerial: int


@dataclass(frozen=True)
Expand Down Expand Up @@ -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
)


Expand Down