# Path: art/utils/fire.py
# class Gun(object):
# 
#     def __init__(self, matrix):
#         self.points = []
#         self.expires = int(matrix.numpix/2)
#         self.location = self._locationGenerator(matrix)
#         self.hue = getHueGen(step=0.05, hue=randint(0, 100)/100.0)
# 
#     def _locationGenerator(self, matrix):
#         x, y = 0, 0
# 
#         while True:
#             for x in range(matrix.width-1):
#                 yield x, y, -1, 1
# 
#             for y in range(0, matrix.height-1):
#                 yield matrix.width-1,  y, -1, -1
# 
#             for x in range(matrix.width-1, 0, -1):
#                 yield x, matrix.height-1, 1, -1
# 
#             for y in range(matrix.height-1, 0, -1):
#                 yield 0, y, 1,  1
# 
#     def fire(self, matrix):
#         x, y, dx, dy = next(self.location)
# 
#         point = Point(x, y, dx, dy, next(self.hue))
#         self.points.append(point)
# 
#         if len(self.points) > self.expires:
#             point = self.points.pop(0)
#             point.expire(matrix)
# 
#         for point in self.points:
#             point.update(matrix, self.expires)


from ._baseclass import ArtBaseClass
from .utils.fire import Gun



class Art(ArtBaseClass):

    description = "Dense Balistics"

    def __init__(self, matrix, config):
        self.gun = Gun(matrix)

    def start(self, matrix):
        matrix.setFirmwareConfig(nointerp=True)

# Path: art/utils/fire.py
# class Gun(object):
# 
#     def __init__(self, matrix):
#         self.points = []
#         self.expires = int(matrix.numpix/2)
#         self.location = self._locationGenerator(matrix)
#         self.hue = getHueGen(step=0.05, hue=randint(0, 100)/100.0)
# 
#     def _locationGenerator(self, matrix):
#         x, y = 0, 0
# 
#         while True:
#             for x in range(matrix.width-1):
#                 yield x, y, -1, 1
# 
#             for y in range(0, matrix.height-1):
#                 yield matrix.width-1,  y, -1, -1
# 
#             for x in range(matrix.width-1, 0, -1):
#                 yield x, matrix.height-1, 1, -1
# 
#             for y in range(matrix.height-1, 0, -1):
#                 yield 0, y, 1,  1
# 
#     def fire(self, matrix):
#         x, y, dx, dy = next(self.location)
# 
#         point = Point(x, y, dx, dy, next(self.hue))
#         self.points.append(point)
# 
#         if len(self.points) > self.expires:
#             point = self.points.pop(0)
#             point.expire(matrix)
# 
#         for point in self.points:
#             point.update(matrix, self.expires)


# Path: art/densefire.py
from ._baseclass import ArtBaseClass
from .utils.fire import Gun




class Art(ArtBaseClass):

    description = "Dense Balistics"

    def __init__(self, matrix, config):
        self.gun = Gun(matrix)

    def start(self, matrix):
        matrix.setFirmwareConfig(nointerp=True)

        matrix.clear()