def __init__ (self, screen, x, y): Device.__init__(self, screen, x, y) self.radius = 12 self.color = (0, 96, 191) self.packetColor = (128, 128, 191) self.selectColor = (191, 191, 191) self.selectable = False self.selected = False #Similar to router self.font = pygame.font.Font(None, 28) self.IPfont = pygame.font.SysFont(u'couriernew,courier', 18, bold=True) self.selectable = False self.name = "" self.names = {}
def __init__ (self, screen, x, y): Device.__init__(self, screen, x, y) self.color = (0, 128, 128) self.timer = 0 self.packetColor = (128, 255, 128) self.selectColor = (191, 191, 191) self.selectable = True self.selected = False self.IPfont = pygame.font.SysFont(u'couriernew,courier', 18, bold=True) self.font = pygame.font.Font(None, 36) self.table = {} #All IPs -> (weight, local Link) self.interfaces = {} #local Link -> local IP self.IP = "IP Unset"
def __init__ (self, screen, x, y, radius=20): Device.__init__(self, screen, x, y) self.radius = radius self.rect = pygame.Rect(x-self.radius, y-self.radius, 2*self.radius, 2*self.radius) self.owner = None self.count = 0 self.color = (96, 96, 96) self.selectColor = (223, 223, 233) self.selected = False self.font = pygame.font.Font(None, 36) self.timeToNewPacket = 0 self.maxTimeToNewPacket = 1500//radius self.timeToSend = 0 self.maxTimeToSend = 3 self.forwardOn = None