hackingTileData.py (1745B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\hacking\hackingTileData.py 2 from eve.client.script.ui.hacking import hackingUIConst 3 4 class TileData(object): 5 6 def __init__(self, id = None, type = None, subtype = None, coord = None, blocked = False, hidden = False, strength = 0, coherence = 0): 7 self.id = id 8 self.type = type 9 self.subtype = subtype 10 self.coord = coord 11 self.blocked = blocked 12 self.hidden = hidden 13 self.strength = strength 14 self.coherence = coherence 15 self.distanceIndicator = 0 16 self.neighbourTiles = [] 17 18 def Update(self, **kw): 19 for key, value in kw.iteritems(): 20 setattr(self, key, value) 21 22 def GetHexXY(self): 23 hexX, hexY = self.coord 24 if hexY % 2: 25 hexX += 0.5 26 return (hexX, hexY) 27 28 def GetXY(self): 29 hexX, hexY = self.GetHexXY() 30 x = hexX * hackingUIConst.GRID_X 31 y = hexY * hackingUIConst.GRID_Y 32 return (x, y) 33 34 def SetNeighbours(self, neighbourTiles): 35 self.neighbourTiles = neighbourTiles 36 37 def GetNeighbours(self): 38 return self.neighbourTiles 39 40 def IsFlippable(self): 41 for neighbour in self.neighbourTiles: 42 if not neighbour.hidden and not neighbour.blocked: 43 return True 44 45 return False 46 47 def __repr__(self): 48 return 'id=%s, type=%s, subtype=%s, coord=%s, blocked=%s, hidden=%s, strength=%s, coherence=%s, distanceIndicator=%s' % (self.id, 49 self.type, 50 self.subtype, 51 self.coord, 52 self.blocked, 53 self.hidden, 54 self.strength, 55 self.coherence, 56 self.distanceIndicator)