Exemplo n.º 1
0
    def recruit_unit(self, n):
        if n == 0:
            unit = Units.Infantry(self.current_player)
        elif n == 1:
            unit = Units.Tank(self.current_player)

        if self.current_player not in self.purchases:
            self.purchases[self.current_player] = []

        self.purchases[self.current_player].append(unit)
Exemplo n.º 2
0
    def starting_conditions(self, n):
        for tile in self.border_tiles:
            for i in range(n):
                inf_unit = Units.Infantry(owner=tile.owner)
                tank_unit = Units.Tank(owner=tile.owner)
                tile.units.append(inf_unit)
                tile.units.append(tank_unit)
                tank_unit.set_position(tile.cords)
                inf_unit.set_position(tile.cords)

        # All the way to the left
        tile = self.map.board[int(self.map.board.__len__() / 2) - 1][0]
        tile.constructions.append(Buildings.Industry(owner=tile.owner))
        print(self.map.board.__len__())
        # All the way to the right
        tile = self.map.board[int(self.map.board.__len__() / 2) - 1][self.map.board.__len__() - 1]
        tile.constructions.append(Buildings.Industry(owner=tile.owner))