So i have a class:
class Unit(object):
def __init__(self, name, x , y, z):
self.name = name
self.strength = x + y
self.intelligence = x + z
self.speed = y + z - x
and two species of these Units
class Red(Unit):
def __init__(self, name, x, y, z):
Unit.__init__(self,name, x, y, z)
self.strength = self.strength * 2
class Blue(Unit):
def__init__(self, name, x, y, z):
Unit.__init__(self, name, x, y, z)
self.speed = self.speed * 2
I want the race to be decided based on what x, y, z, was used as input (z > x means the unit belongs to class Red and x > z means the unit belongs to class Blue) without having to set one before hand, how do I do this?