def __init__(self, world, default=0.0, default_power=None, data=None, power=None): if default_power is None: default_power = default self.world = world self.next_data = [] for y in range(0, self.h): self.next_data.append([default] * self.w) self.data = copy2d(self.next_data) if data is None else data self.base_power = [] for y in range(0, self.h): self.base_power.append([default_power] * self.w) self.power = copy2d(self.base_power) if power is None else power
def apply(self): self.data = copy2d(self.next_data)
def reset_powers(self): self.power = copy2d(self.base_power)